Plz. Help -- Open in a new browser window

Brijesh81

Active member
Joined
Jul 2, 2003
Messages
25
Location
New Delhi
I am using C# and ASP.Net to develop a web application.

I want to call another web form from one web form. But the second web form should get open in a new browser window.

I am using the following code.

Response.Redirect("Preview.aspx");

It opens the web form <Preview.aspx> but in the same browser window...

Pl. help....Any help is greatly appreciated...

Thanks a lot....
 
Hi Brijesh81,

Response.Redirect is a server function which redirects the actual page to another. From the serverside you cant open a new window, this is the clients job and your server has no feeling how many windows are opend on the clientside...

Here is some code example to open a new window:
Code:
<input type="button" onclick="window.open(yourASPXfile.aspx);">

or if needed from serverside:
C#:
this.RegisterClientScriptBlock("openWindow", "<script language=javascript>window.open(yourASPXfile);</script>");

-WebJumper
 
Back
Top