ASP.NET MVC view state
Can anyone explain me how view state is handled in ASP.NET MVC 3. I know that in MVC view state is not there.
But just wanted to know how exactly is the data handled fro开发者_StackOverflowm one page to another page.
For eg.: I have two view in my classes "Create" -> creates a new person and "Index" -> displays the list of person in "Person" modal.
So when I create a new peson using HttPost and then in this post method i go to index view.
So here how the data is been handled as View state is not there.
Please help me out.
Thansk in advance!!!!
When you click submit the data is pushed into the form object of the request just like any other normal form submit.
It looks for a matching action to handle the request, and finds the one with your person model.
It invokes the default data model binder, which attempts to match up form data to object properties.
The action is invoked with the result of the model binder.
I would strongly suggest picking up a good book on the subject, also please review your existing questions and consider accepting any correct provided answers.
In Post or Get Request Every input object like textbox that is in the Form tag, post or get to the action in controller that specified in action attribute in form tag like action="demo_form:
<form action="controller/actionName" method="get">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="Submit">
</form>
the name of property is name of your input name and the value of property is text that you typed in the input .in controller you have specified an action like "actionName" that has input object that this object have property name like your input name in the view.mvc maps property value of request to the same property name of object in your action input parameter
精彩评论