473,725 Members | 2,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

After onclick code runs, open new window, close self?

Hi, could have sworn I used this before and don't understand why this
isn't working?

I have a button with onclick event:

do some database updates, etc.

then, open a new window (a confirmation that updates are done) and close
the current form.

If lreturn2 <> -1 Then

Response.Write( "<script
language=javasc ript>parent.rig ht.location='Er rorMsgEmail.asp x'</script>"
)

Else
'load confirmation page
Response.Write( "<script
language=javasc ript>window.ope ner.location='U serMsgTimerClos e.aspx';self
.close()</script>")

End If

In debug (vb.net), the Response.write line in Else gets highlighted but
then the form just "appears" and ignores it. I tried putting a variable
on page load (if postback) but the page doesn't reload after "submit".

Admittedly, a bit confused, if anyone is in the mood to enlighten me?

Thanks, Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
2 5502
Not sure why you want to close "_self", I would think it's kind of dangerous
if you are persisting anything with Session State variables.

Here is the code I use to open new window

Response.Write( "<script language=javasc ript>")
Response.Write( "window.open('s omeform.aspx', 'somewindowname ', 'toolbar=no,
other window options...');")
Response.Write( "</script>")

Hope this helps
Paul W
Nov 17 '05 #2
Hi, I need to close the opener window...it is the end of what the user
will do (internal app).

That exact script worked in another page, just wondering what
circumstances might be where it would be prevented from
working...myste ry to me.

Thanks,
Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3

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

Similar topics

3
4306
by: Tim Williams | last post by:
Hi. I'm starting to learn wxPython and for an exercise I'm writing a simple CSV file viewer. I just read in the CSV file and create a wx.Grid with the data. I'm using Python 2.3.2 with wxPython 2.4.2.4. Everything runs fine under linux, but when I try the same code on a Win XP machine, I have a window, but the frame the grid is in isn't seen until I do a minimize/maximize on the window. Besides that, it seems to run fine. I tried to...
17
61442
by: Mike Gratee | last post by:
Is it possible to use JavaScript to cause the browser to click a link on a page and have the browser act exactly like the user had clicked on the link directly? In other words, I need to programmatically issue a JavaScript statement which causes the browser to act just like the user clicked on a link in my page. And if that link has an onClick JS event defined, I'd want that onClick event to execute too, exactly the same as if the user...
4
47535
by: Bill | last post by:
I need help closing a CMD window when it is executed from Access. 1) The batch file is called from Access. 2) Access closes, 3) the batch runs a copy of the access database (creating a backup) 4) Once the copy is complete, the batch file opens the Access database again 5) EXIT should close out the cmd window but it does not execute that line
4
1920
by: louise raisbeck | last post by:
I have this scenario (simplified) function addnewdata () { check for partial match already in db for information entered by user if (partialmatch succeeds) { open new window aspx page (using javascript) with a datagrid of these partial match records (by doing a sqlcommand using some query string values taken from opener data entered) *** }
4
2117
by: Tad Marshall | last post by:
Hi, I'm having limited luck getting an ApplicationException to work right in my code. This is VB.NET, VS 2003, Windows XP SP2, .NET Framework 1.1. I thought it would be convenient to take advantage of exception handling to deal with the case of the user clicking the Cancel button while a long operation was running. So, I declared a class inherited from ApplicationException and I Throw one of these with the text "User pressed Cancel"...
4
21282
by: Gabriella | last post by:
Hi, I have a popup window that opens from a page on my website. This popup is a form with several fields. Upon submit button it redirects to a server side ASP page which writes all data to the DB. I would like the popup to close immediately after the submit button is clicked, and data is saved, (or cancel button) - but this does not happen.
9
5482
by: shiks1305 | last post by:
Hi all, I want to submit a form after confirmation through a customised window. I have 4 buttons in <af:form>, one of which is continue button that has to navigate the form to another page while executing the action: -------------------------------------------------------- <af:commandButton id="continueBtn" onclick="return NewWindow()" action="#{CoverageMPB.process}" text="continue" />...
1
2271
idsanjeev
by: idsanjeev | last post by:
<%@ Language =vbscript%> <% Option Explicit %> <html> <head><TITLE>VOICE OF BARAUNIANS</TITLE></head> <body> <!--#include file="front.inc"--> <div style="Position:Absolute; width:700; TOP:0; left:180; background-color:#f0f0f0"> <% Dim conn dim objrs
3
6389
by: sungung | last post by:
Hi group, I want to back orginal scroll postion after reload page. Is it possible? My situation is call popup windows -enter data on popup -close popup -refresh parent page -reload data. As you know, scroll position will be 0,0 after reloading page. But I want to go the postion where user click the link for popup windows.
0
8752
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
9401
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
9179
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,...
1
6702
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...
0
6011
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3228
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
3
2157
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.