Introduction:
Here I will explain how to open pdf from hyperlink in griedview.
Description:
Example:
protected void data_grd_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRow row = ((System.Data.DataRowView)e.Row.DataItem).Row; HyperLink hlink = e.Row.FindControl("link") as HyperLink; if (hlink != null) { string url = string.Format("file/{0}", row["filename"]); hlink.NavigateUrl = url; hlink.Text = "Read"; } } }
0 comments :
Post a Comment