首页 新闻 会员 周边

为什么获取的ihlDeati, ihlEdit 为null,求赐教

0
悬赏园豆:5 [待解决问题]

  protected void gvUserInfo_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            User u = (User)(e.Row.DataItem);
            e.Row.Cells[0].Text = u.LoginName;
            e.Row.Cells[1].Text = u.PassWord;
            e.Row.Cells[2].Text = u.Name;        
            HyperLink ihlDeati = (HyperLink)e.Row.FindControl("ihlDeati");
            HyperLink ihlEdit = (HyperLink)e.Row.FindControl("ihlEdit");
            ihlDeati.NavigateUrl = string.Format("user-detail.aspx?id={0}", u.Id);
            ihlEdit.NavigateUrl = string.Format("user-edit.aspx?id={0}", u.Id);
          
           
        }
    }

灬丶的主页 灬丶 | 初学一级 | 园豆:2
提问于:2016-10-11 23:13
< >
分享
所有回答(1)
0

怎么看着你的代码根本不用这么写,直接在aspx里面搞定就行???你这不都是绑定吗?在aspx里面直接绑定不行?

顾晓北 | 园豆:10844 (专家六级) | 2016-10-12 09:36
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册