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)
{
....
}
}
 
Back
Top