zoukankan      html  css  js  c++  java
  • 代码片段

    1.grid判断查看哪一行的CheckBox被选中      

    foreach(GridViewRow row in this.StudentGridView.Rows)
            {
                Control ctrl = row.FindControl("CheckBox");
             
                    if ((ctrl as CheckBox).Checked)
                    {
                        TableCellCollection cell = row.Cells;
                        string studentCode = cell[1].Text;
                     }                
             }

    2.递归

    // 清空控件内容
    private void ClearText(Control ctr) {
        for (int i = 0; i < ctr.Controls.Count; i++) {
            // 若当前控件内部包含其他控件则继续遍历
            if (ctr.Controls[i].Controls.Count > 0) {
                ClearText(ctr.Controls[i]);
            } else {
                // 判断控件类型,做相应处理
                if (ctr.Controls[i] is TextBox) {
                    TextBox txt = null;
                    txt = ctr.Controls[i] as TextBox;
                    txt.Text = string.Empty;
                } else if (ctr.Controls[i] is ComboBox) {
                    ComboBox cbo = null;
                    cbo = ctr.Controls[i] as ComboBox;
                    cbo.Text = string.Empty;
                }
            }
        }
    }
  • 相关阅读:
    3139:[HNOI2013]比赛
    3143: [Hnoi2013]游走
    目前游戏行业内部主要几款游戏引擎的技术对比
    6.使用AngularJS模板来创建视图
    css选择器(E[att^=”val”]序号选择器)
    5.把作用域实现为数据模型
    4.了解AngularJS模块和依赖注入
    3.创建基本的AngularJS应用
    2.AngularJS MVC
    1.AngularJS初探
  • 原文地址:https://www.cnblogs.com/dodui/p/2369816.html
Copyright © 2011-2022 走看看