zoukankan      html  css  js  c++  java
  • 为DataGrid行添加事件

    private void grid_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
      {
       if(e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer )
       {
        e.Item.Attributes.Add("onmouseover","this.setAttribute('BKC',this.style.backgroundColor);this.style.backgroundColor='#FF0000'");
        e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=this.getAttribute('BKC');");


       }

      }


    private void OnItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
       {
            
    if(e.Item.ItemType != ListItemType.Header && e.Item.ItemType != ListItemType.Footer )
            {
                LinkButton btnSave 
    = (LinkButton)e.Item.Cells[2].Controls[0];
          string strClientID 
    = btnSave.ClientID; //得到该控件的客户端ID,可供JavaScript调用
                btnSave.Attributes.Add("onclick","Javascript:return confirm('Are you sure to save?');");
            }
    }

  • 相关阅读:
    notion笔记
    PHP性能分析工具xdebug+qcachegrind
    Homebrew1.5之后安装PHP和扩展
    Yii2 创建新项目目录
    MAC的一些实用
    Item2 + zsh
    YII2 RBAC Admin User权限相关
    ITEM 2 MAC OSX 功能略强大的终端
    MAC终端配色Solarized
    微服务 SpringCloud + docker
  • 原文地址:https://www.cnblogs.com/ltjabc/p/214647.html
Copyright © 2011-2022 走看看