code_junkie

Is Request.IsAjaxRequest() broken in the MVC RC1 refresh

Nov 14th, 2011
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <% using (Ajax.BeginForm("Contact", "AboutUs", new AjaxOptions()
  2. {
  3. OnBegin = "submitComments_begin",
  4. OnSuccess = "submitComments_success",
  5. OnFailure = "submitComments_failure",
  6. OnComplete = "submitComments_complete",
  7. LoadingElementId = "submitting"
  8.  
  9. }, new { id="fooForm" }))
  10.  
  11. Request["__MVCASYNCPOST"] = "true"
  12.  
  13. Request.IsAjaxRequest()
  14.  
  15. public static bool IsAjaxRequest2(this HttpRequestBase request)
  16. {
  17. return !string.IsNullOrEmpty(
  18. request.Params["__MVCASYNCPOST"] as string);
  19. }
Add Comment
Please, Sign In to add comment