net MVC 4 I followed the microsoft tutorials on how to pass a parameter to a controller from a cshtml view in mvc and I keep getting an error that says the resource cannot be found.If I put a break point in the cshtml I can actually see the value of the Id but it is not hitting the controller at all seems like it cant find it
Description: 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: /UploadLogs/DisplayUploadedFileContents/89
This is my controller method
public class DisplayUploadedFileController : Controller
{
private MarketingDBEntitiesModel db = new MarketingDBEntitiesModel();
// GET: DisplayUploadedFile
public ActionResult DisplayUploadedFileContents(int UploadId)
{
return View(db.marketingdbclients_dataTable.OrderByDescending(r => r.ClientId).Where(r => r.ClientDataId < 1000).ToList());
// return View();.
}
}
My line in the cshtml
<td>
@*@Html.ActionLink("Details", "Details", new { id = item.UploadId })*@
@Html.ActionLink("Details", "DisplayUploadedFileContents", new { id = item.UploadId })
</td>
My route config
routes.MapRoute(
name: "DisplayUploadedFileContents",
//url: "",
url: "{controller}/{action}/{id}",
defaults: new { controller = "DisplayUploadedFile", action = "DisplayUploadedFileContents", id = UrlParameter.Optional });