code_junkie

Using a named route in Form.Begin in ASP.NET MVC

Nov 13th, 2011
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <% Form.Begin(...) %> <!-- no overload for providing a route name --%>
  2.  
  3. <form action="/Products/Command/ViewProduct" method="post">
  4.  
  5. action="<%= Ajax.RouteLink("Update Status", "product-route-short", new { action = "GetStatus", sku = "" }, new AjaxOptions { UpdateTargetId = "status" })%>"
  6.  
  7. <%= Url.RouteUrl("NamedRoute", new { controller="Controller", action="Action", foo="Bar" ... }) %>
  8.  
  9. public string BeginForm(string actionName, string controllerName)
  10. public string BeginForm(string actionName)
  11. public string BeginForm(string routeName, string actionName) // Uh oh!
Add Comment
Please, Sign In to add comment