asp.net mvc 4 - Ommitting additional parameter variable name from Url.Action string -


i have call within table follows:

td><a href="@url.action("editcoursesection", "admin", new { courseid = @coursesection.coursesectionid })"><i class="icon-edit"></i></a></td> 

i want return url of: /admin/editcoursesection/1

but returning url of: /admin/editcoursesection?courseid=1

how can omit additional parameter details variable number declared after this?

you need change routing (or add new routing) in global.asax follows:

routes.maproute(                 name: "anyname",                 url: "admin/{action}/{courseid}",                 defaults: new { controller = "admin", action = "editcoursesection", courseid = urlparameter.optional}             ); 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -