HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
By maintaining the object in your Web Form in ViewState (View State), you can save a lot of coding.
In classic ASP, when a form is submitted, all form values are cleared. Suppose you submit a form with a lot of information, and the server returns an error. You have to return to the form corrections. You click the Back button, and then what happened /en/en/en all form values are cleared, you have to start everything! Site does not maintain your ViewState.
ASP .NET in, when a form is submitted, the form together with the form values appear together in the browser window. How to do it? This is because ASP .NET maintains your ViewState. ViewState will be submitted to the server when the page indicate its status. This state is through on every page with a <form runat = "server"> control the placement of a hidden field definition. Source code is as follows:
Maintaining the ViewState is the default setting for ASP.NET Web Forms. If you do not want to maintain the ViewState, at the top of x page that contains instructions <% @ Page EnableViewState = "false"%>, or add properties EnableViewState = "false" to any control.
Look at the following x file. It demonstrates the "old" operating mode. When you click on the submit button, the form value will disappear:
Here is the new ASP .NET way. When you click on the submit button, the form value will not disappear:
Click on the example of the right frame to view the source code, you will see the ASP .NET has added a hidden field in the form to maintain the ViewState.