Click here to Skip to main content
14,382,054 members
Rate this:
Please Sign up or sign in to vote.
See more:
i have a gridview and there is two field.

1. document path which is visible false
2. title of document and it is link button.

so, if i have 5 documents title so when i click on particular title it`s path automatically take and open file from some folders like Admin/document/xx.pdf .. Here xx.pdf is title come from selected link button and that file i want to open in same window.

Updated 20-Apr-12 0:52am
Praveen Meghwal 20-Apr-12 5:38am
Please make your question more clear and if possible post code snippets.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Set the Command Name for Link Button as "OpenDoc".

I assume that the document path you are saving in ItemTemplate of the gridview as a label with id "lblDocPath".

On GridView Command Event add this below code.

//GridView Command Event
       Label docPath = (Label)((sender as LinkButton).Parent.FindControl("lblDocPath"));

hope it works
sjelen 20-Apr-12 7:02am
"System.Diagnostics.Process.Start(docPath.Text);" on server side?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100