Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Controlstate confusion

Reply
Thread Tools

Controlstate confusion

 
 
r.vries
Guest
Posts: n/a
 
      12-26-2007
Hi,

I'm just starting with asp.net and created a toolbar (custom) control.

Everything works fine but when I do a postback a pushed button gets
'the 'unpushed' state...

I'm using LoadControlState and SaveControlState but the events aren't
fired in the order I thought they would.

Postback occured
-LoadControlState fired
-SaveControlState fired

This explains why my button loses its state after a postback.

But why is the state loaded before it is saved?

Best regards,
Ron
 
Reply With Quote
 
 
 
 
r.vries
Guest
Posts: n/a
 
      12-26-2007
ps. I solved 'the pushed button' issue with a hidden field, so I'm not
looking for a solution.
But I'm just a bit confused by the behaviour of saving and loading the
controlstate.
 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      01-14-2008
Hi,

control state is saved initially on the first request when you load the
page. Then on postback, it is first loaded back (on the server) , used in
the process of dealing with the request (in respect to the control), and
then again finally saved for the next postback (containing possible
changes).

--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

"r.vries" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> ps. I solved 'the pushed button' issue with a hidden field, so I'm not
> looking for a solution.
> But I'm just a bit confused by the behaviour of saving and loading the
> controlstate.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Control's ViewState and ControlState? Edward ASP .Net 2 05-12-2008 02:29 PM
ViewState to Session and ControlState compressed bill ASP .Net 1 12-07-2007 06:12 PM
Why ViewState/ControlState Loaded After CreateChildControls? Mark Olbert ASP .Net 5 02-01-2007 02:39 AM
asp.net ControlState kelly ASP .Net 0 07-24-2006 09:21 PM
Error while using 'ControlState' property in my custom control =?Utf-8?B?UGF2YW4=?= ASP .Net 0 12-07-2005 10:46 AM



Advertisments