Im creating dynamic checkboxes on page_load(by getting the number of floors of a building from database)

if user checks any one of floor checkboxes and hits generateflats button(Postback) then I will refer to the flats existing in that particular floor and I will generate flats(checkboxes ) dynamically.

the problem is I cant get the properties of these checkboxes if I hit the save button.


How can I restore the properties of the dynamic controls(Check boxes)

This is very much urgent for my project Plzzzzzzzzz help me

Recommended Answers

All 2 Replies

man, my explanation isnt clear, but as i understood and correct me if i am wrong.
u r creating checkboxes dynamically, representing floors or flats in certain floor.
ur problem is when u create checkbox represneting flats in specific floor and then u want to restore the checkboxes representing the total floors created during the page_load.

if that is the problem, u have to create hidden varaiable and put in it the number of floors created during the page_load. then when u want to restore the floors just refer to this var and create checkboxes and no need to read from database twice.

sam

use the viewstate

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.