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);
}
}
怎么看着你的代码根本不用这么写,直接在aspx里面搞定就行???你这不都是绑定吗?在aspx里面直接绑定不行?