473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

How close opening window?

mg
Once opening WebForm2 from WebForm1 using

Response.Write("<script language='javascript'>window.open
('WebForm2.aspx','two','menubar=no');</script>");

how can I [programmatically] close WebForm1?
Nov 18 '05 #1
7 2205
This should work..

Response.Write("<script language='javascript'>window.open
('WebForm2.aspx','two','menubar=no');window.close
();</script>");
-----Original Message-----
Once opening WebForm2 from WebForm1 using

Response.Write("<script language='javascript'>window.open
('WebForm2.aspx','two','menubar=no');</script>");

how can I [programmatically] close WebForm1?
.

Nov 18 '05 #2
you can use ControlHelper to help you .
if you use it ,you won't write these scripts.
close a window?just is:
controlHelper1.CloseWindow("returnValue");

why not try?

http://www.lostinet.com/en/lwsamplec...controlhelper/

--
http://www.lostinet.com/
Lostinet.Web Controls&Components help you to build better Asp.Net
CustomerControl&UserControl&Application.
ControlHelper&HelperElement for MessageBox&Dialog
ComboBox,ComboCalendar,SmartIframe
---------------------------
Remote Asp.Net Execution

"mg" <mg@theworld.com> ???? news:0f****************************@phx.gbl...
Once opening WebForm2 from WebForm1 using

Response.Write("<script language='javascript'>window.open
('WebForm2.aspx','two','menubar=no');</script>");

how can I [programmatically] close WebForm1?

Nov 18 '05 #3
God, I hate it when someone asks a question about how to do something and
the response is to use a 3rd party tool/component when the functionality
doesn't require it.
"Lostinet.Web Support" <lo*********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
you can use ControlHelper to help you .
if you use it ,you won't write these scripts.
close a window?just is:
controlHelper1.CloseWindow("returnValue");

why not try?

http://www.lostinet.com/en/lwsamplec...controlhelper/

--
http://www.lostinet.com/
Lostinet.Web Controls&Components help you to build better Asp.Net
CustomerControl&UserControl&Application.
ControlHelper&HelperElement for MessageBox&Dialog
ComboBox,ComboCalendar,SmartIframe
---------------------------
Remote Asp.Net Execution

"mg" <mg@theworld.com> ???? news:0f****************************@phx.gbl...
Once opening WebForm2 from WebForm1 using

Response.Write("<script language='javascript'>window.open
('WebForm2.aspx','two','menubar=no');</script>");

how can I [programmatically] close WebForm1?


Nov 18 '05 #4
mg
Thanks!

But, I failed to mention that I need to first open
WebForm2 and then close WebForm1 without the end user
having to press an OK button before the close can occur.

I'd very much appreciate knowing how to do this!
-----Original Message-----
This should work..

Response.Write("<script language='javascript'>window.open
('WebForm2.aspx','two','menubar=no');window.clo se
();</script>");
-----Original Message-----
Once opening WebForm2 from WebForm1 using

Response.Write("<script language='javascript'>window.open
('WebForm2.aspx','two','menubar=no');</script>");

how can I [programmatically] close WebForm1?
.

.

Nov 18 '05 #5
mg
I need to first open
WebForm2 and then close WebForm1 without the end user
having to press an OK button before the close can occur.

Will controlHelper1.CloseWindow("returnValue");

accomplish this?

-----Original Message-----
you can use ControlHelper to help you .
if you use it ,you won't write these scripts.
close a window?just is:
controlHelper1.CloseWindow("returnValue");

why not try?

http://www.lostinet.com/en/lwsamplecs/? framesrc=controlhelper/
--
http://www.lostinet.com/
Lostinet.Web Controls&Components help you to build better Asp.NetCustomerControl&UserControl&Application.
ControlHelper&HelperElement for MessageBox&Dialog
ComboBox,ComboCalendar,SmartIframe
---------------------------
Remote Asp.Net Execution

"mg" <mg@theworld.com> ???? news:0f7901c3beab$87a6b380

$a*******@phx.gbl...
Once opening WebForm2 from WebForm1 using

Response.Write("<script language='javascript'>window.open ('WebForm2.aspx','two','menubar=no');</script>");

how can I [programmatically] close WebForm1?

.

Nov 18 '05 #6
Hi!

You can use javascript from within your code like below!

Response.Write("<script language='javascript'>window.opener =
self</script>")
Response.Write("<script language='javascript'>window.close()</script>")

Explaination why 2 lines:

You will be prompt with a message box to confirm the closing of the
window if you are trying to close a window via javascript which hasn't
been opend by a javascript! (like you dow with your winform2.aspx)
To avoid that we set the opener to itself (which is the first line of
code) and there you go - the window is closing.

You can put that WHEREEVER in your code - so after you call the
javascript to open winform2.aspx - cut the window.close() out of that
line - you ad the new two lines as shown below
#VB
Response.Write("<script
language='javascript'>window.open('WebForm1.aspx', 'two','menubar=no')</s
cript>")
Response.Write("<script language='javascript'>window.opener =
self</script>")
Response.Write("<script language='javascript'>window.close()</script>")
TADA

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #7
of cause. but the IE will prompt a confirm only when : the window is not
opened by another window and IE version is lower than 6

--
http://www.lostinet.com/
Lostinet.Web Controls&Components help you to build better Asp.Net
CustomerControl&UserControl&Application.
ControlHelper&HelperElement for MessageBox&Dialog
ComboBox,ComboCalendar,SmartIframe
---------------------------
Remote Asp.Net Execution

"mg" <mg@theworld.com> ???? news:10*****************************@phx.gbl...
I need to first open
WebForm2 and then close WebForm1 without the end user
having to press an OK button before the close can occur.

Will controlHelper1.CloseWindow("returnValue");

accomplish this?

-----Original Message-----
you can use ControlHelper to help you .
if you use it ,you won't write these scripts.
close a window?just is:
controlHelper1.CloseWindow("returnValue");

why not try?

http://www.lostinet.com/en/lwsamplecs/?

framesrc=controlhelper/

--
http://www.lostinet.com/
Lostinet.Web Controls&Components help you to build better

Asp.Net
CustomerControl&UserControl&Application.
ControlHelper&HelperElement for MessageBox&Dialog
ComboBox,ComboCalendar,SmartIframe
---------------------------
Remote Asp.Net Execution

"mg" <mg@theworld.com> ???? news:0f7901c3beab$87a6b380

$a*******@phx.gbl...
Once opening WebForm2 from WebForm1 using

Response.Write("<script language='javascript'>window.open ('WebForm2.aspx','two','menubar=no');</script>");

how can I [programmatically] close WebForm1?

.

Nov 18 '05 #8

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

Similar topics

5
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to...
3
by: Jonan | last post by:
Hi, I use JavaScript I have tree windows. Jonan1.html has this code erref1=window.open("Jonan2.html", "mypage",null); This opens Jonan2.html and it has this code...
10
by: Madame Blablavatsky | last post by:
hello, i have a few links on a page. when one clicks a link an pop up window with an image opens. when people click an other link i want the already availible pop up window to close before the...
18
by: Roger Withnell | last post by:
I open a new window from the current window to display maps. Several maps of different sizes can be displayed. The function is given the size of the map and adjusts the window size accordingly....
7
by: mg | last post by:
I need to first open WebForm2 from WebForm1 and then close WebForm1 without the end user having to press an OK button before the close can occur. For example, possibly ...
7
by: Paul | last post by:
Hi I have a web application that has a log off selection, just redirects the browser to a form with a label displaying you are loging off. In part of the application I open a new window and was...
2
by: Buddha Pest | last post by:
The 1st window opens the 2nd window. The 2nd window opens the 3rd window. From the 3rd window, how do I close the 3rd and 2nd windows then change the URL of the 1st window? Thanks.
7
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed...
10
by: Heinrich Wolf | last post by:
Hi all, Please direct me to a current treatise of window.close(). My info is that a window can be closed provided it has been opened by the same script or functions within the same document....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.