1

When I make a POST request to ASP.NET MVC app, I'm getting HTTP 400 Bad Request. I have decorated the post action with [ValidateInput(false)], but still i am getting this error.

I have a model which is the parameter of the POST method.

Any suggestions for this?

abatishchev
  • 98,240
  • 88
  • 296
  • 433
nimi
  • 5,359
  • 16
  • 58
  • 90
  • 1
    Please provide more details. For example, does an exception get thrown by your MVC application? – Richard Ev Apr 20 '12 at 09:33
  • Please post sample code of your application to give us a better idea of what's going on. – coffeeyesplease Apr 20 '12 at 09:42
  • A 400 means there is something wrong with your request. Usually something is malformed or too large. Without more info, we can't really say what... – Kenneth Ito Apr 23 '12 at 23:37
  • 1
    i hosted this in IIS and i came to see that its working fine. It was giving the issue asp.net development server. – nimi Apr 25 '12 at 04:15

1 Answers1

0

Instead of Model as parameter to action, use Viewmodel Pattern, it will be much clearer what data you post. Post the code of the View, and the code of the Model.

Community
  • 1
  • 1
croisharp
  • 1,926
  • 5
  • 25
  • 40