469,267 Members | 971 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

will checkboxes lose their state after postback?

Hi

I have build a datalist with checkboxes in it and after a postback the state
of the checkboxes have not been saved. I have enabled the viewstate of all
the controls on this page. What do I have to implement to keep the state?

ch Jimmy
Nov 19 '05 #1
3 3101
Are these checkboxes bound to a data source? If so, have you updated the
data source in the postback and re-bound the datalist to the data source?
"Jimmy" <be****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

I have build a datalist with checkboxes in it and after a postback the
state
of the checkboxes have not been saved. I have enabled the viewstate of all
the controls on this page. What do I have to implement to keep the state?

ch Jimmy

Nov 19 '05 #2
Scott
They are not bound to a datasource...
In this case the viewstate does not take care of this? So I have to write
code to put the values of the (un)checked boxes back?

Ch Jimmy
"Scott M." <s-***@nospam.nospam> wrote in message
news:Ob*************@TK2MSFTNGP10.phx.gbl...
Are these checkboxes bound to a data source? If so, have you updated the
data source in the postback and re-bound the datalist to the data source?
"Jimmy" <be****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi

I have build a datalist with checkboxes in it and after a postback the
state
of the checkboxes have not been saved. I have enabled the viewstate of all the controls on this page. What do I have to implement to keep the state?
ch Jimmy


Nov 19 '05 #3
Yes, you seems to have to override the SaveViewstate and LoadViewstate
method in order to reload the value.

..NET framwork will not take care of them because to the framwork, they are
essentially something recreated(i.e.: they are not the origional checkboxes
after postback, they're just another group of checkboxes that process the
same ID as the destroyed ones)

"Jimmy" <be****@gmail.com> glsD:OB**************@TK2MSFTNGP12.phx.g bl...
Scott
They are not bound to a datasource...
In this case the viewstate does not take care of this? So I have to write
code to put the values of the (un)checked boxes back?

Ch Jimmy
"Scott M." <s-***@nospam.nospam> wrote in message
news:Ob*************@TK2MSFTNGP10.phx.gbl...
Are these checkboxes bound to a data source? If so, have you updated the
data source in the postback and re-bound the datalist to the data source?
"Jimmy" <be****@gmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Hi
>
> I have build a datalist with checkboxes in it and after a postback the
> state
> of the checkboxes have not been saved. I have enabled the viewstate of all > the controls on this page. What do I have to implement to keep the state? >
> ch Jimmy
>
>



Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by terence.parker | last post: by
2 posts views Thread by Glenn Owens | last post: by
7 posts views Thread by DJ Dev | last post: by
8 posts views Thread by mark.norgate | last post: by
6 posts views Thread by arun.hallan | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.