How ASP.NET knows previous input when submitting a form

When a user goes to register on my site, and if they enter incorrect information, he redirects them back to the same page in order to correct errors on the login page. When they are redirected, the username and other information that they entered earlier are in the form fields. Why it is not that it is bad or something else, but I would like to change this behavior, if possible. Here is the code I'm using

<tr>
     <td class="style1">Username</td>
          <td>
               <%= Html.TextBox("username") %>&nbsp;&nbsp;
          </td>
</tr>
+3
source share
2 answers

View.ModelState. Html.TextBox . , , .

+2

asp.net ViewState. , , ViewState. . , EnableViewState = false .

<%@ Page enableViewState="false" %> 

viewstate . .

0

Source: https://habr.com/ru/post/1763539/


All Articles