How to make eachcontrol inside update panel to readonly.

private static void DisableControl(System.Web.UI.Control control)
        {
            System.Reflection.PropertyInfo enProp = control.GetType().GetProperty("Enabled");
            if (enProp != null)
            {
                enProp.SetValue(control, false, null);
            }

            foreach (System.Web.UI.Control ctrl in control.Controls)
            {
                DisableControl(ctrl);
            }
        }

-------------------------------------------------
//Calling
DisableControl(update panel id);

Comments

Popular posts from this blog

Executing PowerShell scripts from C#

HOW TO Use the NumericUpDown Control

Exposing Agile Software Development Myths