code_junkie

asp.net mvc framwork information propagation

Nov 13th, 2011
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <td><%=Html.TextBox("Date")%></td>
  2. <td><%=Html.TextBox("City")%></td>
  3.  
  4. public ActionResult XXX(string Date, string City) {...}
  5.  
  6. public ActionResult CreateCourseDate(string Date, string City, int id)
  7.  
  8. http://example.com/course/newcoursedate/1
  9.  
  10. <% using (Html.BeginForm( "CreateCourseDate",
  11. "Course",
  12. new { id = ViewData.Model.CourseID }, ...
  13.  
  14. ...
  15.  
  16. <td><%=Html.TextBox("Date")%></td>
  17. <td><%=Html.TextBox("City")%></td>
  18.  
  19. <% } %>
  20.  
  21. <% using (Html.BeginForm("YourActionName", "YourControllerName", new { id = yourid })) { %>
  22. ...
  23. <td><%=Html.TextBox("Date")%></td>
  24. <td><%=Html.TextBox("City")%></td>
  25. ...
  26. <input type="submit" value="Submit" />
  27. <% } %>
Add Comment
Please, Sign In to add comment