disable controls recursively

by pietman 13. October 2011 11:24

 

private void RecursDisableCtrls(Control ctr)
        {
                    if (ctr.Controls.Count > 0)
                        foreach (Control ee in ctr.Controls)
                        {
                            RecursDisableCtrls(ee);
                        }
                    {
                        if (ctr is WebControl)
                        {
                            if ((ctr as WebControl).ID == "ButtonCancel") //exclude this butt e.g.
                                return;
                            (ctr as WebControl).Enabled = false;
                        }
                    }
        }

 

Tags:

c#

Add c0mment




  Country flag
biuquote
  • Comment
  • Preview
Loading


About ...

pietman celliersPietman Celliers
Bitlink  Ltd
bitlinkit.com