asp.net mvc - how to replace & from id in mvc 4? -
i have mvc 4 project. site showing info in form of table many link. using
<%: html.actionlink("edit", "editreport", "phed", new {.rpid = item.id,.returnurl = request.url.pathandquery}, new {key .class = "ico edit"})%> my reoute.config
routes.maproute( _ name:="default", _ url:="{controller}/{action}/{id}", _ defaults:=new {.controller = "phed", .action = "index", .id = urlparameter.optional} _ ) it shows link as
example.com/phed/editreport?rpid=2&returnurl=phed how can route request
example.com/phed/editreport?rpid=2/returnurl=phed i want replace '&' ampersand in id slash / or other character?
no need alter route, pass url llok like:
example.com/phed/editreport/2/returnurl=phed for code :
<%: html.actionlink("edit", "editreport", "phed", new {.id= item.id,.returnurl = request.url.pathandquery}, new {key .class = "ico edit"})%> asp.net-mvc asp.net-mvc-4
No comments:
Post a Comment