Posted on: 2/18/2015 2:01:24 PM | Views : 672

In my gridview, I have a label called 'label4' which contains names.  I would like to implement the following logic:
Logic --> if names(label4) matches tags, then replace name value with a URL
This what I have so far:
public void gvUserInfo_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Label name = (Label)e.Row.FindControl("Label4"); DataTable tags = LoadAllTags(); string nme = name.Text; if (tags.Rows.Count > 0) { nme = nme.Replace(tags.Rows[0].ToString(), "<a href=\"http://www.domain.com/test.aspx?Search=" + tags.Rows[0].ToString() + ">" + tags.Row[0].ToString() + "</a>"); } } } Howe ...

Go to the complete details ...