Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi All I Want to need when i click link are button that document file are open to other tab window browser Example in gmail the attechment view document link when click na It will open other tab browser the pdf are any other files are not possible to edit and copy i want need that code please give me reply for thishttp://www.codeproject.com/Questions/ask.aspx#
Posted
Updated 20-Jul-12 8:59am
v2
Comments
StianSandberg 20-Jul-12 15:56pm    
what?

1 solution

All you need to do is specify the target attribute of the link tag,
The following code...
C#
HtmlAnchor ahref = new HtmlAnchor();
ahref.HRef = "Your-PDF-File.pdf";
ahref.Target = "_blank";
ahref.InnerHtml = "Click this link to open PDF in a new window";


Produces:
HTML
<a href="Your-PDF-File.pdf" target="_blank">Click this link to open PDF in a new window</a>
 
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