code_junkie

asp.net mvc post to different views in same form

Nov 12th, 2011
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. routes.MapRoute(
  2. "Books",
  3. "Books/{searchExpr}/{pageId}",
  4. new { controller = "Books", action = "Search", searchExpr = "", pageId = 1 }
  5. );
  6.  
  7. <form id="form1" name="form1" action="/Books/" method="get">
  8. <input type="text" name="search" value="">
  9. <input type="submit" name="id" value="1">
  10. <input type="submit" name="id" value="2">
  11. </form>
  12.  
  13. <form id="form1" name="form1" action="/Books/1" method="get">
  14. <!--...form fields-->
  15. </form>
  16.  
  17.  
  18. <form id="form2" name="form2" action="/Books/2" method="get">
  19. <!--...form fields-->
  20. </form>
Add Comment
Please, Sign In to add comment