Control Collection in a page

  • Thread starter Thread starter sri_san
  • Start date Start date
S

sri_san

Hello,
I am trying to get reference to all the button controls present in
a webpage/usercontrol. I need to set a property common to all the
buttons at runtime. Not sure how to go about it.
Any help would be great!

Thanks,
Sam.
 
foreach (Control control in Controls)
{
if (control is Button || control is LinkButton)
{
....
}
}
 

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

Back
Top