I discovered a defect on my website ... and I am not sure if it is a bug ... or it is by design.
I have the following route registered.
routes.MapRoute("EditProduct", // Route name
"product/addproduct/{id}", // URL with parameters
new { controller = "Product", action = "AddProduct", id = UrlParameter.Optional }
);
In _Layout.cshtml I have the following link defined:
<li><a href="@Url.Action( "AddProduct", "Product")">Add new product</a></li>
If the current url contains the 'Id' parameter, for example: /product/details/5, the menu link from layout is generated /product/addproduct/5. It is taking the id parameter from RequestContext.
Is this a bug ... since in the helper I do not specify the parameters for my link? ... or this is by design?