0

How to open file(Display), Which is stored in directory in c# when click on link button in gridview.

In my application i am storing documents in directory.

I am displaying those documents path in gridview, Now i want to open particular document in new window or radwindow when click on link button of particular row.

My Code is.

protected void ImgBtnView_Click(object sender, EventArgs e)
{
    try
    {
        GridViewRow clickedRow = ((ImageButton)sender).NamingContainer as GridViewRow;
        Label lblID = (Label)clickedRow.FindControl("lblFileName");
        string strDoc_FileName = lblID.Text.ToString();
        filePath = lblID.Text.ToString();
        // code to open file here ? 
    }
    catch { }

}

here filePath is geting location of file. Now i want to open that file in radwindow..Thanks

Marshall777
  • 1,196
  • 5
  • 15
Sri
  • 1
  • 1
  • Could you show some effort, show some code please. – Max Jan 09 '14 at 10:07
  • protected void ImgBtnView_Click(object sender, EventArgs e) { try { GridViewRow clickedRow = ((ImageButton)sender).NamingContainer as GridViewRow; Label lblID = (Label)clickedRow.FindControl("lblFileName"); string strDoc_FileName = lblID.Text.ToString(); filePath = lblID.Text.ToString(); } catch { } } here filePath is geting location of file. Now i want to open that file in radwindow..Thanks.. – Sri Jan 09 '14 at 10:12
  • add this to your question please... – Max Jan 09 '14 at 10:14
  • See http://stackoverflow.com/questions/10174156/open-file-with-associated-application – Marshall777 Jan 09 '14 at 10:28
  • Hi,Its not working.Thanks.. – Sri Jan 09 '14 at 10:44

0 Answers0