I have an ASP.Net MVC 4 app and am using the Url.Action helper like this: @Url.Action(\"Information\", \"Admin\")
This page is used for both adding a ne
You also can use in this form:
<a href="@Url.Action("Information", "Admin", null)"> Admin</a>
outgoing url in mvc generated based on the current routing schema.
because your Information action method require id parameter, and your route collection has id of your current requested url(/Admin/Information/5), id parameter automatically gotten from existing route collection values.
to solve this problem you should use UrlParameter.Optional:
<a href="@Url.Action("Information", "Admin", new { id = UrlParameter.Optional })">Add an Admin</a>