title: What would cause a MVC4 controller to only return a status code and no partial view?
body: <p>This is sort of an odd question but then I have a very odd situation.  On my development server (IIS &amp; IIS Express) I make a ajax request and return a form.  The user then posts the form back via an ajax post and if there are any validation errors the controller sends back the partial view with a response code of 400.  In my ajax method I intercept any 400 errors and redisplay the form with the validation errors.  </p>
  
  <p>My problem is that when I upload my app to my production server all I get on a validation error is the 400 response with no partial view.  I don't know even where to begin?  Here is what I have tried, what libraries I am using, and some sample code.</p>
  
  <p>ASP.net MVC4,
  Fluent Validation,
  jQuery, unobtrusive validation, malsup-ajaxsubmit</p>
  
  <p>On my production server...</p>
  
  <ol>
  <li>My partial view that loads the form works as expected.  This tells me that the application is having no problem finding my view as the same view is redisplayed if validation fails.</li>
  <li>My controller using fluent validation is correctly detecting a model state error and responding with a 400 (just no view with it).</li>
  <li>My ajax post using ajaxsubmit is posting to the server correctly using ajax.</li>
  <li>Using firebug I step through my ajax method and an 400 error is indeed returned but the only content on xhr.responseText is "Bad Request".  NO partial view.  Again my development machine works perfectly.</li>
  </ol>
  
  <p>Here is some code.</p>
  
  <p>My Form Get Request:</p>
  
  <pre><code>public ActionResult CreateMedicalEvent(int userId)
  {
      var model = new EventModel { MedicalEventUserId = userId };
  
      return PartialView("_Event.Create", model);
  }
  </code></pre>
  
  <p>My Form Post:</p>
  
  <pre><code>[HttpPost]
          public ActionResult CreateMedicalEvent(EventModel model)
          {
              if (!ModelState.IsValid)
              {
                  Response.StatusCode = 400;
                  return PartialView("_Event.Create", model);//this does not get returned on production server
              }
  
              //the rest of my code if validation passess
          }
  </code></pre>
  
  <p>My ajax method:</p>
  
  <pre><code> $('.se-form').ajaxForm({
          delegation: true,
          beforeSubmit: function() {
              ajaxHelpers.modalProcess();//modal progress bar
          },
          success: function(data) {
              $.modal.close();
              //handle a successful post
          },
          error: function(xhr) {
              $.modal.close();
              if (xhr.status == 400) {
                  slideEdit.seObj.empty();//this is my form object
                  slideEdit.seObj.append(xhr.responseText);//all I get is "Bad Request" from production server
                  $.validator.unobtrusive.parse($('form', slideEdit.seObj));
                  ajaxHelpers.bindDates(); //because we need to bind event AND format date, we have to do this here
                  utilities.formatDecimal();
              } else {
                  ajaxHelpers.exc(xhr);
              }
          }
      });
  </code></pre>
  
  <p>I wish there was more code to post but this isn't all that complicated.  Am I missing some weird dll file on my production server?  Both servers have MVC4 installed.  Lost.  Pleas help.  Thanks.</p>