This MVC stuff is fun but every step along the way theres another little hurdle.
I'm just using Request.IsAjaxRequest for the first time today in conjunction with Microsoft's AJAX library. I am NOT yet using jQuery (I had to mention that since I just hyperlinked to a question about jQuery!).
Unfortunately I installed RC1 refresh BEFORE I tested this code.
I am using Ajax.BeginForm
.
<% using (Ajax.BeginForm("Contact", "AboutUs", new AjaxOptions()
{
OnBegin = "submitComments_begin",
OnSuccess = "submitComments_success",
OnFailure = "submitComments_failure",
OnComplete = "submitComments_complete",
LoadingElementId = "submitting"
}, new { id="fooForm" }))
When my controller action executes these are my headers :
Connection Pragma, Content-Length, Content-Type, Accept, Accept-Encoding, Accept-Language, Host, Referer, User-Agent, UA-CPU
In addition the FORM contains this Param
Request["__MVCASYNCPOST"] = "true"
And the end effect is that this returns false!
Request.IsAjaxRequest()
I get the issue with Chrome and Internet Explorer.
Please tell me if I'm doin something silly - or if something just broke.
Final thought: Hmm - perhaps I need a new futures DLL. I'll update if that turns out to be the issue