I have a problem with getting/handling POST data from <form>
in ASP.NET MVC 4 Razor project.
What have I done?
- defined such a method in Controller: http://ideone.com/dMhlVV
- defined such a markup for
@section
http://ideone.com/Wyx8vQ
Don't argue at my code, I'm only testing ASP.NET MVC 4 features.
As you can see in the controller's code, I've done also a Model for user info:
public class AuthForm
{
public string Login { get; set; }
public string Password { get; set; }
}
I thought, that ASP.NET if the model is correct will automatically parse data into the model, but mistaken.
Then I tried to use .Request["name"]
, but (inputs weren't empty):
Also I've tried to use such Attributes:
[HttpPost]
[AcceptVerbs(HttpVerbs.Post)]
But also no success!
What did I wrong? Please, help me to fix my issues.
Thanks