I read that viewstate does not exist in an asp.net MVC application. I am doing a model check. Now, if I have two text fields on my page, and I do a mandatory check for both of them in the model. This check is done on the server side with the click of a button. I will fill in one text box and click submit. It performs validation and returns a result that requires a second field. At this time, the value of the first text field is saved. So can you tell me how this text box retains value even after postback?
The text box value is tied to the model value.
Model , (.. ) ModelState.
, -)
,
Dan
" ". .
Controller.ModelState
ModelState
Errors
, , Html.TextBox("someName", someValue), someValue, ModelState "someName", ModelState. ( ), .
Html.TextBox("someName", someValue)
someValue
"someName"
ModelState. http-, ModelState html- (Html.Label, Html.Hidden, Html.TextBox).
. , ( ModelState) , , ModelState.
Source: https://habr.com/ru/post/1740460/More articles:ruby on rails - ruby | fooobar.comHow are 6 trits equal to 9.5 bits? - bitswhy does internet explorer display my page in javascript back? - javascriptPHP - Нельзя использовать Heredoc в методе класса? - phpAn XmlDocument type was not found, although I referenced System.XML? - reference.dll application name is .netHow long does MySQL take to create an index - mysqlCannot convert value in attribute '[attr]' to an object of type 'System.Windows.TemplateBindingExtension' - wpfUsing parameter values in an SQL statement - sqlWhy does my homespun sizeof operator need cast char *? - cAll Articles