Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
pdf file is in gridview control,,i want to open this pdf to other NEW PAGE using link button...how to do?
Posted
Comments
Kiran Susarla 12-Feb-13 4:05am    
Is this not a repost of http://www.codeproject.com/Questions/544686/howplustoplusopenpluspdfplusinplusnewpluswebplusbr

Use gridview template field
C#
<asp:templatefield headertext="PDF">
                            <itemtemplate>
                                <a href="<%#Eval("pdfurl")%>" target="_blank">
                                Open
                                </a>
                            </itemtemplate>
                        <itemstyle horizontalalign="Center" verticalalign="Top" />
                        </asp:templatefield>
 
Share this answer
 
v2
Add this in the HTML tag of link button
OnClientClick="javascript:window.open('http://www.codeproject.com');"


if you want to add this from server side

lnkButton.Attributes.Add("onclick", "window.open('http://www.codeproject.com');");
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900