1 protected void grdProfile_RowDataBound(object sender, GridViewRowEventArgs e)
2 {
3 int UID = 0;
4 try
5 {
6 if (e.Row.RowType == DataControlRowType.DataRow)
7 {
8 HtmlAnchor hPhoto = (HtmlAnchor)e.Row.FindControl("aPhoto");
9 UID = Convert.ToInt16(grdProfile.DataKeys[e.Row.RowIndex].Values["UID"]);
10 if (hPhoto != null && UID>0)
11 {
12 hPhoto.Attributes["onclick"] = string.Format("javascript:viewPhoto({0})", UID.ToString());
13 }
14 }
15 }
16 catch (Exception ex)
17 {
18
19 }
20 }