title: How to detect and reject a non-JavaScript post to MVC controller
body: <p>Is there a simple way I can detect and reject a non-JavaScript post to an MVC Controller?</p>
  
  <p>Say I have some JavaScript that submits the form via Ajax:</p>
  
  <pre><code>function SubmitForm()
  {
     var data = $("form").serialize();
  
     $.post("/MyController/MyAction/", data, function(data, response){
         //Process response
     });
  
     return false;
  }
  </code></pre>
  
  <p>If the user disables JavaScript the form will still post to the controller via a standard form post. I understand that I can't stop it posting but can I detect and reject a non-JavaScript post from the controller and send the user to an error page?</p>
  
  <p>I also understand that this is probably not something that is a standard part of the Controller's functionality so I am wondering if anyone has come up with a trick for achieving this.</p>