P
pargat.singh
Hi :
I am using Master/Child page in VS2005 and i wrote generic function
to show/hide controls which works fine if i don't use master/child
[menas it work fine in single page].Below is my function which work
fine for single page to show/hide controls.
private void displayOrHideControls(string ctrlNames, string Mode)
{
string[] arControlNames = ctrlNames.Split(new char[] { ';' });
for (int i = 0; i < arControlNames.Length; i++)
{
string name = arControlNames.ToString();
foreach (Control ctrl in Page.Controls)
{
if (ctrl.HasControls())
{
foreach (Control ctrl2 in ctrl.Controls)
{
if (ctrl2.ID == name)
{
if (Mode == "SHOW")
{
ctrl2.Visible = true;
}
else if (Mode == "HIDE")
{
ctrl2.Visible = false;
}
}
}
}
}
}
}
Can anyone please tell me how can i loop through content page controls?
Thanks,
Pargat
I am using Master/Child page in VS2005 and i wrote generic function
to show/hide controls which works fine if i don't use master/child
[menas it work fine in single page].Below is my function which work
fine for single page to show/hide controls.
private void displayOrHideControls(string ctrlNames, string Mode)
{
string[] arControlNames = ctrlNames.Split(new char[] { ';' });
for (int i = 0; i < arControlNames.Length; i++)
{
string name = arControlNames.ToString();
foreach (Control ctrl in Page.Controls)
{
if (ctrl.HasControls())
{
foreach (Control ctrl2 in ctrl.Controls)
{
if (ctrl2.ID == name)
{
if (Mode == "SHOW")
{
ctrl2.Visible = true;
}
else if (Mode == "HIDE")
{
ctrl2.Visible = false;
}
}
}
}
}
}
}
Can anyone please tell me how can i loop through content page controls?
Thanks,
Pargat