|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retaining Checkbox values during postback (ASPX)I have a page with several server controls placed on there at design
time, including a blank table control. During runtime I add some controls to the table, including some checkboxes, which I called ch() as checkbox. the user would then check some of them and click a button. the event handler for the button would save the checkbox checked state to a database. but as soon as the button is clicked, ch() is nothing. all the other design time controls have retained their values, but not the checkboxes. Scott First, do these checkboxes have EnableViewState=True? Do all of their parent
Controls have EnableViewState=True? If they do, you can try adding some code to the Page.Load event that reads the checked state from the database so that each time the page loads it sets the checked state to whatever the user selected the last time. If you don't want to have to go to the trouble of reading from the database, you could use Cookies or Session variables and only worry about reading the database for long-term purposes, it all depends on exactly what your site is used for. If you need help figuring out how to do any of these things feel free to ask. Good Luck! Show quoteHide quote "Scott H" <x@x.com> wrote in message news:bmni12h9skam9o3pkjjagl5cs6lmqgjibq@4ax.com... > > I have a page with several server controls placed on there at design > time, including a blank table control. > > During runtime I add some controls to the table, including some > checkboxes, which I called ch() as checkbox. the user would then > check some of them and click a button. > > the event handler for the button would save the checkbox checked state > to a database. > but as soon as the button is clicked, ch() is nothing. all the other > design time controls have retained their values, but not the > checkboxes. > > Scott
Reading Stream After RedirectStandardOutput=True Blocks
I can't find the error here.... Serial Date Stored procedure handling 1 parent record and multiple child recor vb.net to c# conversion help please Loop through columns of all datarows in a dataset my form cannot from from network Problems using HasMorePages with oleDbDatareader Hide some columns of listview Question re byte arrays and strings |
|||||||||||||||||||||||