473,503 Members | 11,237 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you use Response.Redirect to open a new browser window?

Can anyone help with how to use the Response.Redirect method to open a page
in a new instance of the browser. In this case it is a report. When the
user selects a report from a list then I want to display the report but when
they close the report the resport list window (browser) should stay open.
Any help would be greatly appeciated.
Thanks.
--
John at Free Design
Dec 19 '05 #1
2 2628
Response.Redirect() is server side action, which cannot open a new browser
window on user end. Alos, more and more anti-popup measures are applied to
newer browsers. Opening a new browser window should only be resulted in by
ned user's explicit action, such as lick a button/link...

You should use client side code (javascript) to open a new Window. Here is
an example:

Assume you have a server control "LinkButton1"

private void Page_Load(....)
{
if (!Page.IsPostBack)
{
LinkButton1.Attributes.Add("onclick","OpenNewWindo w('http://mysite/mypage.aspx?ID=111');return
false;");
}
}

Then in the HTML source of the page, add following script in
<Header></Header>
<script language="javascript">
function OpenNewWindow(url)
{
var win;
win=window.open(url,"NewWindow",
"width=800,height=600,toolbar=0,status=1,resizable =1,scrollbars=1");
win.focus();
}
</script>

"John at Free Design" <Jo**************@discussions.microsoft.com> wrote in
message news:65**********************************@microsof t.com...
Can anyone help with how to use the Response.Redirect method to open a
page
in a new instance of the browser. In this case it is a report. When the
user selects a report from a list then I want to display the report but
when
they close the report the resport list window (browser) should stay open.
Any help would be greatly appeciated.
Thanks.
--
John at Free Design

Dec 19 '05 #2
Norman,
Thanks for the quick and accurate response.
--
John at Free Design
"Norman Yuan" wrote:
Response.Redirect() is server side action, which cannot open a new browser
window on user end. Alos, more and more anti-popup measures are applied to
newer browsers. Opening a new browser window should only be resulted in by
ned user's explicit action, such as lick a button/link...

You should use client side code (javascript) to open a new Window. Here is
an example:

Assume you have a server control "LinkButton1"

private void Page_Load(....)
{
if (!Page.IsPostBack)
{
LinkButton1.Attributes.Add("onclick","OpenNewWindo w('http://mysite/mypage.aspx?ID=111');return
false;");
}
}

Then in the HTML source of the page, add following script in
<Header></Header>
<script language="javascript">
function OpenNewWindow(url)
{
var win;
win=window.open(url,"NewWindow",
"width=800,height=600,toolbar=0,status=1,resizable =1,scrollbars=1");
win.focus();
}
</script>

"John at Free Design" <Jo**************@discussions.microsoft.com> wrote in
message news:65**********************************@microsof t.com...
Can anyone help with how to use the Response.Redirect method to open a
page
in a new instance of the browser. In this case it is a report. When the
user selects a report from a list then I want to display the report but
when
they close the report the resport list window (browser) should stay open.
Any help would be greatly appeciated.
Thanks.
--
John at Free Design


Dec 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
629
by: margaret | last post by:
James suggested that I used window.open on the client side to open a new window. I created a test ASP app and can get it work fine. But now I'm trying to fix my real app, which is in ASP.NET. It...
4
8383
by: Max Dupenois | last post by:
I've seen numerous articles with similair (similar sp?) titles to this in my search.. unfortunately none of them seem to contain what i want, (or if they do i need someone to point out my stupidity...
2
3688
by: Jules Lucas | last post by:
Can I do some kind of response.redirect to a new browser window? I need to use session variables in the new window and process some things on the page load.
3
818
by: Sehboo | last post by:
On my ASP page, when I click a button, I want to do three things: 1. Check for some values. 2. Open a new window and pass some values as query string. 3. Redirect to some other page Here...
3
3563
by: ODB | last post by:
Okay what i need is to open af new browser windows with some link in, but i can't get the Response.Redirect to open af new window, and when i redirect to a new page in the same window and then hit...
11
26771
by: Russ | last post by:
My web app writes some binary data to a file at the client site via Response.Write and Response.BinaryWrite. This action is accomplished in response to a button click, with C# code behind as...
9
11698
by: anuragsji | last post by:
Hi, I have one combo box and GO button on the click of GO button page submitted and according to selection of one of the option from combo I want to redirect my page to some new asp page but at...
4
970
by: Dave | last post by:
Is there a way to do a Response.Redirect and do a popup on the redirect?
12
7872
by: Jim Rodgers | last post by:
I have a big asp file that has an error under certain conditions -- totally repeatable. However, it only fails when I set response.buffer = True at the top. WHen I set it False in order to debug...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.