Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
All-Star
128483 Points
18150 Posts
MVP
Nov 25, 2008 02:27 AM|LINK
Try something like this:
C#
protected void Button4_Click(object sender, EventArgs e) { string path = @"D:\Data\Monthly Report\March.pdf "; Page.ClientScript.RegisterStartupScript(this.GetType(), "Pop up", "window.open('" + path + "','','');", true); }
VB.NET
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Dim path As String = "D:\Data\Monthly Report\March.pdf " Page.ClientScript.RegisterStartupScript(Me.[GetType](), "Pop up", "window.open('" & path & "','','');", True) End Sub
You may also look here:
http://dotnetguts.blogspot.com/2006/09/popup-pdf-file-in-new-window-from.html
vinz
All-Star
128483 Points
18150 Posts
MVP
Re: Open a new Window on Button_click event
Nov 25, 2008 02:27 AM|LINK
Try something like this:
C#
protected void Button4_Click(object sender, EventArgs e)
{
string path = @"D:\Data\Monthly Report\March.pdf ";
Page.ClientScript.RegisterStartupScript(this.GetType(), "Pop up", "window.open('" + path + "','','');", true);
}
VB.NET
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim path As String = "D:\Data\Monthly Report\March.pdf "
Page.ClientScript.RegisterStartupScript(Me.[GetType](), "Pop up", "window.open('" & path & "','','');", True)
End Sub
You may also look here:
http://dotnetguts.blogspot.com/2006/09/popup-pdf-file-in-new-window-from.html
MessageBox Controls for WebForms | Blog | Twitter | Linkedin