473,748 Members | 7,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How close opening window?

mg
Once opening WebForm2 from WebForm1 using

Response.Write( "<script language='javas cript'>window.o pen
('WebForm2.aspx ','two','menuba r=no');</script>");

how can I [programmaticall y] close WebForm1?
Nov 18 '05 #1
7 2241
This should work..

Response.Write( "<script language='javas cript'>window.o pen
('WebForm2.aspx ','two','menuba r=no');window.c lose
();</script>");
-----Original Message-----
Once opening WebForm2 from WebForm1 using

Response.Write ("<script language='javas cript'>window.o pen
('WebForm2.asp x','two','menub ar=no');</script>");

how can I [programmaticall y] 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("re turnValue");

why not try?

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

--
http://www.lostinet.com/
Lostinet.Web Controls&Compon ents help you to build better Asp.Net
CustomerControl &UserControl&Ap plication.
ControlHelper&H elperElement for MessageBox&Dial og
ComboBox,ComboC alendar,SmartIf rame
---------------------------
Remote Asp.Net Execution

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

Response.Write( "<script language='javas cript'>window.o pen
('WebForm2.aspx ','two','menuba r=no');</script>");

how can I [programmaticall y] 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.W eb Support" <lo*********@ho tmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.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("re turnValue");

why not try?

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

--
http://www.lostinet.com/
Lostinet.Web Controls&Compon ents help you to build better Asp.Net
CustomerControl &UserControl&Ap plication.
ControlHelper&H elperElement for MessageBox&Dial og
ComboBox,ComboC alendar,SmartIf rame
---------------------------
Remote Asp.Net Execution

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

Response.Write( "<script language='javas cript'>window.o pen
('WebForm2.aspx ','two','menuba r=no');</script>");

how can I [programmaticall y] 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='javas cript'>window.o pen
('WebForm2.asp x','two','menub ar=no');window. close
();</script>");
-----Original Message-----
Once opening WebForm2 from WebForm1 using

Response.Writ e("<script language='javas cript'>window.o pen
('WebForm2.as px','two','menu bar=no');</script>");

how can I [programmaticall y] 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("re turnValue");

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("r eturnValue");

why not try?

http://www.lostinet.com/en/lwsamplecs/? framesrc=contro lhelper/
--
http://www.lostinet.com/
Lostinet.Web Controls&Compon ents help you to build better Asp.NetCustomerContro l&UserControl&A pplication.
ControlHelper& HelperElement for MessageBox&Dial og
ComboBox,Combo Calendar,SmartI frame
---------------------------
Remote Asp.Net Execution

"mg" <mg@theworld.co m> ???? news:0f7901c3be ab$87a6b380

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

Response.Write( "<script language='javas cript'>window.o pen ('WebForm2.aspx ','two','menuba r=no');</script>");

how can I [programmaticall y] close WebForm1?

.

Nov 18 '05 #6
Hi!

You can use javascript from within your code like below!

Response.Write( "<script language='javas cript'>window.o pener =
self</script>")
Response.Write( "<script language='javas cript'>window.c lose()</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='javas cript'>window.o pen('WebForm1.a spx','two','men ubar=no')</s
cript>")
Response.Write( "<script language='javas cript'>window.o pener =
self</script>")
Response.Write( "<script language='javas cript'>window.c lose()</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&Compon ents help you to build better Asp.Net
CustomerControl &UserControl&Ap plication.
ControlHelper&H elperElement for MessageBox&Dial og
ComboBox,ComboC alendar,SmartIf rame
---------------------------
Remote Asp.Net Execution

"mg" <mg@theworld.co m> ???? 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("re turnValue");

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("r eturnValue");

why not try?

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

framesrc=contro lhelper/

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

Asp.Net
CustomerContro l&UserControl&A pplication.
ControlHelper& HelperElement for MessageBox&Dial og
ComboBox,Combo Calendar,SmartI frame
---------------------------
Remote Asp.Net Execution

"mg" <mg@theworld.co m> ???? news:0f7901c3be ab$87a6b380

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

Response.Write( "<script language='javas cript'>window.o pen ('WebForm2.aspx ','two','menuba r=no');</script>");

how can I [programmaticall y] close WebForm1?

.

Nov 18 '05 #8

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

Similar topics

5
9709
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 click that opens the site in a new and larger window via onclick. My question is, can I have the smaller window automatically close when the user clicks the link to visit the site? I also have a link that merely closes the smaller info window if...
3
20612
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 erref=window.showModalDialog("Dialogo.html", null); This opens Dialogo.html How can I do to close Jonan2.html and Dialogo.html from Jonan1.html How can I get the Dialogo.html reference from Jonan1.html.
10
3528
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 other pop up window opens. i just can't get it right, i always get an error message: line: 23
18
2513
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. If a new window is already open, the new map sizes are ignored and the new map is is either too small for the existing "new" window or too big, which is a more serious problem! I've tried to fix this by closing the new window if it is already...
7
2717
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 Response.Write("<script language='javascript'>window.open ('WebForm2.aspx','two','menubar=no');</script>") Is there code that will accomplish this without using 3rd-
7
3046
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 wondering if there is a way to close all windows associated with the web application when the user selects the log off selection? Thanks. -- Paul G Software engineer.
2
1904
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
5827
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 to be two techniques for earlier versions. But the window.opener='' ;window.close(); and the window.open('','_parent','') ;window.close(); techniques do not work for me. I.e., I still get confirmation message
10
3794
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. And this is as far as I've got, but no success:
0
8991
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
9544
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...
0
9372
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9324
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
9247
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
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...
0
6074
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();...
1
3313
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
2215
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.