zoukankan      html  css  js  c++  java
  • 设置页面所有控件

    private void InItControl( ControlCollection connection)
        {
            foreach (System.Web.UI.Control ctrl in connection)
            {
                if (ctrl.HasControls())
                {
                    InItControl(ctrl.Controls);
                }
                else
                {
                    if (ctrl is System.Web.UI.WebControls.TextBox)
                    {
                        ((TextBox)ctrl).ReadOnly = true;
                    }
                    if (ctrl is System.Web.UI.WebControls.DropDownList)
                    {
                        ((DropDownList)ctrl).Enabled = false;
                    }
                    if (ctrl is System.Web.UI.WebControls.RadioButtonList)
                    {
                        ((RadioButtonList)ctrl).Enabled = false;
                    }
                    if (ctrl is System.Web.UI.WebControls.CheckBox)
                    {
                        ((CheckBox)ctrl).Enabled = false;
                    }
                    if (ctrl is System.Web.UI.WebControls.Button)
                    {
                        ((Button)ctrl).Enabled = false;
                    }
                    if (ctrl is System.Web.UI.WebControls.LinkButton)
                    {
                        ((LinkButton)ctrl).Enabled = false;
                    }
                }
            }
        }






    在我的页面上目前只有这些控件   有其他需要设置的   按照方法向上加就是
    在调用的时候写InItControl(Page.Controls);
  • 相关阅读:
    jstree单选功能的实现方法
    JavaScript之HTML DOM Document 对象
    任意用户密码重置漏洞
    MESSAGE_TYPE_X dump in RSM_DATASTATE_CHECK -6-
    高版本Visual Studio和低版本ArcGIS共存 工具箱没有控件的解决方法
    定制Dynamics 365 Portal 界面
    从组件文档引发的惨案 ◤1◢
    图文结合深入理解 JS 中的 this 值
    js获取时间差值
    vscode 同步扩展插件
  • 原文地址:https://www.cnblogs.com/88223100/p/1230093.html
Copyright © 2011-2022 走看看