日期:2014-05-20  浏览次数:20428 次

.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