code_junkie

POST method called on MVC UserControls as well as their parent views

Nov 14th, 2011
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. System.Web.Mvc.dll!System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod
  2.  
  3. <% Html.RenderAction("ContactUsForm", "Company",
  4. new { commentsBoxHeader = "Questions" }); %>
  5.  
  6. [AcceptVerbs(HttpVerbs.Post)]
  7. public ActionResult ContactUsForm(FormCollection formdata)
  8.  
  9. [AcceptVerbs(HttpVerbs.Post)]
  10. public ActionResultContactUsForm(FormCollection formData)
  11. {
  12. if (formData["btnSubmitContactUsForm"] == null) {
  13.  
  14. // "This form is not for us!";
  15. // figure out how (if is possible) to return the get default view here
  16. // and call it with the right arguments
  17. }
  18. }
  19.  
  20. $(document).ready( function() {
  21. $('#mybutton').click( function() {
  22. $('form').submit();
  23. });
  24. });
Add Comment
Please, Sign In to add comment