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

How to create RSS Feed in Asp.Net

Auto generate change scripts in SQL Server Management Studio SSMS for tables

HOW TO Use the NumericUpDown Control