G
Guest
I am trying to make use of the following type of code in a ".cs" class. I
need to pass the Page.Controls collection into a class located in a ".cs"
file (not code behind). I am able to do this with the this mechanism but I
need to do it as a reference or out type.
My goal is to use a database table to do pre button security lookups and
disable
any button that the user does not have security for.
I would be very greatful for any input. Even a better mouse trap.
Thanks in advance
Grosch
foreach (Control c in Page.Controls)
{
foreach (Control childc in c.Controls)
{
if (childc is Button)
{
string sID = childc.ID.ToString();
//do db button lookup and disable if necessary
}
}
}
need to pass the Page.Controls collection into a class located in a ".cs"
file (not code behind). I am able to do this with the this mechanism but I
need to do it as a reference or out type.
My goal is to use a database table to do pre button security lookups and
disable
any button that the user does not have security for.
I would be very greatful for any input. Even a better mouse trap.
Thanks in advance
Grosch
foreach (Control c in Page.Controls)
{
foreach (Control childc in c.Controls)
{
if (childc is Button)
{
string sID = childc.ID.ToString();
//do db button lookup and disable if necessary
}
}
}