Getting Dynamically Create Control Values

G

GregoryJ

I have a web page that Dynamically creates a CheckBox control for each Role
(Forms Authentication) a User belongs to and sets the .Checked property to
TRUE if they belong to the Role.

Displaying this controls works exactly as I wish. Now, I want to allow users
the ability to place a check in any of these Roles and add them to the
necessary Role based on those Check Box that are checked off. But, when my
Save routine is fired off the Dynamic controls don’t seem to exist and thus I
am not able to retrieve the new values a person has applied to the fields.

How can I read the value of a dynamically created check box control during a
PostBack. This would be the check boxes the user has clicked off since the
page was originally posted.
 
C

Craig

GregoryJ said:
I have a web page that Dynamically creates a CheckBox control for each Role
(Forms Authentication) a User belongs to and sets the .Checked property to
TRUE if they belong to the Role.

Displaying this controls works exactly as I wish. Now, I want to allow
users
the ability to place a check in any of these Roles and add them to the
necessary Role based on those Check Box that are checked off. But, when my
Save routine is fired off the Dynamic controls don’t seem to exist and
thus I
am not able to retrieve the new values a person has applied to the fields.

How can I read the value of a dynamically created check box control during
a
PostBack. This would be the check boxes the user has clicked off since the
page was originally posted.

From where are the controls missing - in a new "processing page" or in the
code behind? Also, where are you placing the dynamically created controls?
If inside a table, it could be that you need to go a 1 level deeper to
"find" the controls. If you could please strip down your code and post it, I
would be happy to take a look.

I know this might seem obvious, but are you looking for the dynamic controls
in the page load and if so, are you putting your logic behind a:
if (! this.IsPostBack)
{
....
}

Craig
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top