Is there a viewstate event before postback?

Consider the following: the text value added to the text field on the client is added to the viewstate upon postback (thus, the value is still present in the text field when the page reloads).

How does this happen, when I move the value from listbox1 to listbox2 via jquery, the elements in listbox2 are not added to the viewstate. (note: items are selected before POST, and the values ​​in box2 are available on the server upon postback via request.form.getvalues ​​("listbox2"). getvalue (index) .tostring ())

I am not looking for work, I have it. I want to know the “why” listbox2 values ​​are not added. Is there any event for the text box but not the list? Just trying to better understand what is happening. Thank!

+3
source share
1 answer

The text value added to the text field on the client is added to the viewstate upon postback (thus, the value is still present in the text field when the page reloads).

This statement is incorrect. The value of the server control is TextBoxsaved via postback because the browser sends it to the mail data, and when posting back, it TextBoxcopies the value from the message data to its property Text. The viewing status is not involved, as you can check by setting EnableViewState="False". (I assume that it TextBoxis visible and turned on, otherwise the browser does not send its value to the message data, and a view state is required to save the value.)

, box1 listbox2 jquery, box2 viewstate.

ListBox . ListBox , Items Selected True. Items; , , " ". , .

+3

All Articles