Life without ViewState

P

Piotr Strycharz

The life with ViewState is difficult - say 70kB of mess....

The life without View State is very difficult:
1. No access to Field.Value or Field.Text at Page_Load (are empty)
2. No access to Request.Form["Field"], because "Field" becomes "_ctl1:Field"
or sth
3. No change events, or events without arguments.
4. Cannot assign the values to fields, as they are filling itself
automagically (although ViewState is disabled). See:
http://support.microsoft.com/default.aspx?scid=kb;en-us;316813

Let's say, that after change of the value of <SELECT> I want to change some
other fields.
The only method to work without ViewState, I found so far is:
1. at Page_Load get the data:
string _fieldvalue = Request.From[Field.UniqueId]
2. Check if _fieldvalue is correct
3. Compare _fieldvalue to the previous value stored in Session
4. Correct fields' values
5. Save _fieldvalue to Session variable
6. at Page_PreRender:
Field.Value = _fieldvalue

Stupid, yeah? Any comments?

Regards.

Piotr.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top