hobbes
04-11-2005, 05:43 AM
Hello,
I generate dynamic controls in my web page. And one a certain condition (being met from Oracle table) when the page loads, I need to populate the dynamic controls and then disable them.
I have populated the fields, but disabling the controls is proving a little too difficult to me.
I am able to disable each control individually, but not all controls at once.
This is what I tried,
foreach(Control con in Page.Controls)
{
if(con is TextBox)
((TextBox) con).Enabled = false;
}
Hobbes
I generate dynamic controls in my web page. And one a certain condition (being met from Oracle table) when the page loads, I need to populate the dynamic controls and then disable them.
I have populated the fields, but disabling the controls is proving a little too difficult to me.
I am able to disable each control individually, but not all controls at once.
This is what I tried,
foreach(Control con in Page.Controls)
{
if(con is TextBox)
((TextBox) con).Enabled = false;
}
Hobbes