show-notice
hide-notice

Tuesday, 13 August 2013

open pdf from hyperlink in griedview


Introduction:

Here I will explain how to open pdf from hyperlink in griedview.

Description:

In previous articles I explained 3-Tier Architecture in ASP.NET, Ajax Autocomplete Control in asp.net  , select multiple table in asp.net   Now today i will explain how to open pdf from hyperlink in griedview.



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";
            }
        } 
    }

SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com