473,623 Members | 3,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Poping up a window AND redirecting the page thtat triggered the po

Hi to all. I'm having trouble with the following situation:

I have a page where the user inserts some stuff and when he clicks on the
submit button a popup window showing that info is launched and the page "A"
where he was is redirected to another page, page "B". This page "B" can also
be accessed by other means. Can this be done? If so, how?

I was trying to do this:

protected void button_Click(ob ject sender, EventArgs e)
{
string popupScript = String.Format(" <script language='javas cript'>" +
"window.open('S howReport.ashx' ,'CustomPopUp', " +
"'width=600 , height=500, menubar=no, resizable=yes,
toolbar=no,
location=no, statusbar=no, left=212, top=184')</script>");

Page.RegisterSt artupScript("Sh owReport", popupScript);
Page.Response.R edirect("NewPag e.aspx");
}
But what happens is that I get imediatly redirected to the NewPage.aspx. If
I'm not wrong, this happens because the current page isn't reloaded after
this event is treated. What I am asking is, for the effect I want (both the
pop-up and the redirect occurs) what can I do? I have also thought on trying
to open the pop-up on the loading of NewPage.aspx, by passing some specific
value when I make the redirect (something like
Response.Redire ct("NewPage.asp x?popup=yes").
Any ideas/sugestions?

Thanks in advance

Dec 15 '05 #1
2 1688
Hi Ricardo,

The popup window must be generated on the client. This means that the page
must be loaded to generate the popup. What you can do is to have the page
pop up a window, and then submit back to the server, where the Redirect can
occur.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Ricardo Videira" <Ri************ @discussions.mi crosoft.com> wrote in
message news:2A******** *************** ***********@mic rosoft.com...
Hi to all. I'm having trouble with the following situation:

I have a page where the user inserts some stuff and when he clicks on the
submit button a popup window showing that info is launched and the page
"A"
where he was is redirected to another page, page "B". This page "B" can
also
be accessed by other means. Can this be done? If so, how?

I was trying to do this:

protected void button_Click(ob ject sender, EventArgs e)
{
string popupScript = String.Format(" <script
language='javas cript'>" +
"window.open('S howReport.ashx' ,'CustomPopUp', " +
"'width=600 , height=500, menubar=no, resizable=yes,
toolbar=no,
location=no, statusbar=no, left=212, top=184')</script>");

Page.RegisterSt artupScript("Sh owReport", popupScript);
Page.Response.R edirect("NewPag e.aspx");
}
But what happens is that I get imediatly redirected to the NewPage.aspx.
If
I'm not wrong, this happens because the current page isn't reloaded after
this event is treated. What I am asking is, for the effect I want (both
the
pop-up and the redirect occurs) what can I do? I have also thought on
trying
to open the pop-up on the loading of NewPage.aspx, by passing some
specific
value when I make the redirect (something like
Response.Redire ct("NewPage.asp x?popup=yes").
Any ideas/sugestions?

Thanks in advance

Dec 15 '05 #2
if a page has a redirect header (produced by calling Redirect), the browser
will not render the html, if you want the html rendered, you need to use a
meta tag with a refresh. also popup blocks will prevent you popup window
anyway. you should change the button to a html hyperlink that opens the
report.
-- bruce (sqlwork.com)
"Ricardo Videira" <Ri************ @discussions.mi crosoft.com> wrote in
message news:2A******** *************** ***********@mic rosoft.com...
Hi to all. I'm having trouble with the following situation:

I have a page where the user inserts some stuff and when he clicks on the
submit button a popup window showing that info is launched and the page
"A"
where he was is redirected to another page, page "B". This page "B" can
also
be accessed by other means. Can this be done? If so, how?

I was trying to do this:

protected void button_Click(ob ject sender, EventArgs e)
{
string popupScript = String.Format(" <script
language='javas cript'>" +
"window.open('S howReport.ashx' ,'CustomPopUp', " +
"'width=600 , height=500, menubar=no, resizable=yes,
toolbar=no,
location=no, statusbar=no, left=212, top=184')</script>");

Page.RegisterSt artupScript("Sh owReport", popupScript);
Page.Response.R edirect("NewPag e.aspx");
}
But what happens is that I get imediatly redirected to the NewPage.aspx.
If
I'm not wrong, this happens because the current page isn't reloaded after
this event is treated. What I am asking is, for the effect I want (both
the
pop-up and the redirect occurs) what can I do? I have also thought on
trying
to open the pop-up on the loading of NewPage.aspx, by passing some
specific
value when I make the redirect (something like
Response.Redire ct("NewPage.asp x?popup=yes").
Any ideas/sugestions?

Thanks in advance

Dec 16 '05 #3

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

Similar topics

2
2092
by: Kiran | last post by:
Hi all, Can anybody let me know how to detect when my user clicks the X button on the window. I used unload event it did not work(on IE). My web page is a .asp page which reloads itself when navigating on the site. Now whenever the user clicks any links on the page the unload event is triggered which is not what I want. I only want to detect when user clicks the X button and not when the URL changes. code i used:
2
14939
by: John Mack | last post by:
Intermittently I get the following error on Firefox: "Error: uncaught exception: Permission denied to get property HTMLDocument.window" What can cause this error? I do an image switch via JS just before redirecting the page (also via JS), could this be the problem - not giving enough time to do the image switch before redirecting? Pieces of the page I created that generated this error are below. The
5
1356
by: Buz Waitz | last post by:
I have tried several different versions of javascript to pop up a window from an aspx page. The problem is, that the new page pops up in the current window, not in a popup. The code works in a regular HTML page, using Dreamweaver. I've also used code generators, tried by hand, you name it. Same result. Here's one version of code I used: <script language="javascript" type="text/javascript"> <!-- function PT_poppwin(theURL,winName) {...
3
2458
by: tony | last post by:
I've been searching through the threads to find a solution for 401.3 error triggered by windows authentication not being able to redirect to a custom error page to no avail. It seems that ASP.NET does not redirect 401 errors yet changing the Custom Errors redirect in IIS does not help either. Has anyone found a solution to this problem? Seems like it should be a commonly encountered problem. Any help will be greatly appreciated.
5
3380
by: Mark | last post by:
Hi all, how do I open a javascript window from a code behind page? I was using Response.Write("<script language='javascript'>window.open('url','name','options');</script>") but now for some reason it is not working.. Thanks in advance Mark
4
1319
by: Fernando Chilvarguer | last post by:
Hi, I've been trying to figure this one out for a while and I'm stalled. Here's my scenario: - a Parent window with a datagrid on it. The datagrid has pagination enabled and has an "Edit" link for each record. - Once someone clicks on the "Edit" link, a child window pops-up. The user edits the data and submits the form. All the server code is executed and
1
3229
by: Kalyani | last post by:
Hi, I have a page with a button.On click of this button a popup window opens.Now if this window is kept open until session timeout then login page opens in the same window. Now I want that the popup window should be closed on session timeout and login page should be opened in its parent window.How can I do that? Please do tell me if any one knows. Thanks in advance,
2
1527
by: Kevin Frey | last post by:
We have a web application that, for the purposes of reporting, launches a new window to display the contents of the report in (PDF format). This is implemented using a custom IHttpHandler implementation in our project. The report is launched by a standard hyperlink with a target="blank" to force the new window. The one problem I have noticed is that if the user leaves the "launcher" page open a long time, the web server will invariably...
1
1423
by: runsrealfast | last post by:
I have a search page that will generate results at the bottom of the page. As part of the results each item will have a button that will open a window that will contain a more detailed view of the item and also an open of editing (if the user has prileges.) I am able to get the new window to open, however, the search page refreshes back to my index page. I would like it to stay at its current location, and for the life of me can't...
0
8221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8162
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8662
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8317
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6104
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2593
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 we have to send another system
1
1769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1468
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.