Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void Button1_Click(object sender, EventArgs e)
{
    Response.Redirect("../Files/CV's/CV.pdf");
}
Posted
Comments
CHill60 24-Jan-15 13:02pm    
So what is the problem?
Member 10528646 24-Jan-15 13:26pm    
the page is displaying on the same tab whereas I want it to open in a new tab

1 solution

Use an anchor tag instead of a button click. http://www.w3schools.com/tags/tag_a.asp[^]

You can set the target to "_base" to have it open in a new window or tab, depending on the users browser settings.
 
Share this answer
 
Comments
Member 10528646 24-Jan-15 13:28pm    
this works for whereas I am using a button
ZurdoDev 24-Jan-15 14:01pm    
That's fine. On a button you can set the OnClientClick function to call a javascript function that uses window.open(). That will work too. Or change to an anchor tag, you can always style it to look like a button.

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