Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes Viewstate maintain history
    primarykey
    data
    text
    <p>Based on an answer from a candidate I have a confusion regarding the functioning of ViewState in an ASP.Net application. According to the candidate If you have a control with some value and you change that value, on postback it sends the initial value as well as the changed value to the server. So if you continue to change values and submit, the whole tree is sent to the server. I tried searching online but couldnt get any facts regarding the same.</p> <p>If the above description was confusing, here is an example to give more clarity on the claims:<br/> - We have <code>&lt;asp:TextBox ID="txt1" runat="Server" Text="First Value"/&gt;</code><br/> - After the page loads i enter "Second Value" in <code>txt1</code> and hit submit and same page loads again (since i have written no logic in the click event)<br/> - Now I enter "Third Value" in <code>txt1</code>and hit submit again.<br/></p> <p>According to the candidate the first time I hit submit, both "First Value" &amp; "Second Value" are sent to the server and when the page loads after that, it encrypts both those values and puts it in the ViewState so when I hit submit the second time, the encrypted value in viewstate (which has both "First Value" &amp; "Second Value") is submitted along with "Third Value". </p> <p>I am not from an engineering background and the candidate was and claimed this is what was taught to him in University. I just want to know if there is any amount of truth in those claims. Any help is appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload