469,295 Members | 1,984 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Looping thru all DDL on a form, checking for value

Using VB ..

Is there a way to loop through all drop down lists on a web form
checking for a specific value (ddlDropDown.SelectedValue) and then,
based on that value, cause a specific label to go visible or not?

Thanks,
Jim
Nov 21 '06 #1
1 1308
recursivly loop thru all controls checking the type.

aircode:

LoopThruControls(this);

void LoopThruControls(Control ctl)
{
DropDownList ddl = ctl as DropDownList;
if (ddl !=null)
{
// do somthing with selected value
}
foreach (Control child in ctl.Controls)
{
LoopThruControls(child);
}
}

-- bruce (sqlwork.com)

"Jim in Arizona" <ti*******@hotmail.comwrote in message
news:O4**************@TK2MSFTNGP06.phx.gbl...
Using VB ..

Is there a way to loop through all drop down lists on a web form checking
for a specific value (ddlDropDown.SelectedValue) and then, based on that
value, cause a specific label to go visible or not?

Thanks,
Jim

Nov 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by ensnare | last post: by
4 posts views Thread by David | last post: by
2 posts views Thread by pob | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.