On my main page I have a list of Article items with a link to each item, the link take me to an ArticleController where I can look up the Article based on the postID I have passed as a parameter.
@foreach (var item in Model.PostFeatureList)
{
@Html.ActionLink((string)@item.Title, "Index", "ArticleController");
@Html.Raw(@item.Teaser)
}
What's produced is;
<a postid="101" href="/ArticleController">EEPROM Programmer 2 of 4 - Communications</a>
Which in my mind is correct for debugging on my local machine, assuming that Index action is the default action.
Then in ArticleController.Index I have;
[Route("postID-{id}")]
public ActionResult Index(int? id)
{
Post post = null;
if (id != null)
post = PostService.GetPostById((int)id);
return View(post);
}
So now the question when I click on the link I get;
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /ArticleController
In the calling view I have;
@using (Html.BeginForm())
Do I need something in the BeginForm to tell it where I want to route to or is there some other place I need to let the router know that I want to do this?
Thanks Y'all