c# - use slash as parameter for action method in mvc -
i have 1 mvc application have 1 action method in home controller, below details:
public actionresult index(int id) { //some value return view(); }
now when run application in url put "localhost:1469/home/index/10"
so 10 value should appear in id parameter of action method.
below route code used:
routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "about", id = urlparameter.optional } );
how achieve same?
Comments
Post a Comment