当前位置: 代码迷 >> ASP.NET >> .net 2005 的GridView 的模板列中,怎么取得当前行
  详细解决方案

.net 2005 的GridView 的模板列中,怎么取得当前行

热度:9676   发布时间:2013-02-26 00:00:00.0
.net 2005 的GridView 的模板列中,如何取得当前行?
protected   void   GridView1_RowCommand(object   sender,   GridViewCommandEventArgs   e)
        {


                if   (e.CommandName   ==   "del ")
                {            
                        int   a   =   Convert.ToInt32(e.CommandArgument);                  
                        GridViewRow   row   =   GridView1.Rows[a];
                        string   xh3   =   row.Cells[0].Text;
                        ClientScript.RegisterStartupScript(typeof(Page), " ", " <script> alert( ' "+xh3+ " '); </script> ");
                }
        }
为什么提出来的是空值?

------解决方案--------------------------------------------------------
第一列有没有文字?还是控件?如果是控件就要用findcontrol
  相关解决方案