c# - Can I put a RedirectResult into a view link? -
c# - Can I put a RedirectResult into a view link? -
i have next situation:
into view define link in way:
<a href="@url.action("edit", "vulnerability", new { id = model.id })" data-mini="true" data-inline="true" data-role="button" >annulla</a> as can see when user click link executed edit() method ot vulnerabilitycontroller class passing , id value
ok, works fine in view want have have in controller, thing:
return new redirectresult(url.action("edit", "vulnerability", new { id = vulnid }) + "#tab-2"); as can see in sec version phone call edit() method of vulnerabilitycontroller class value of id variable "1234#tab-2"
can in view , not in controller?
if want render (include) results of action within view can utilize html.action:
@html.action("edit", "vulnerability", new { id = vulnid + "#tab-2" }) see msdn
c# asp.net .net asp.net-mvc
Comments
Post a Comment