473,327 Members | 1,919 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,327 software developers and data experts.

window won't close...

EMW
In my ASPX page I have the following code behind which is activated when the
user clicks on a linkbutton:

Dim sFeatures As String = Chr(34) +
"DiaglogHeigth:50px;DialogWidth:412px;center:yes;h elp:no;resizable:no;scroll
:no;status:no;" + Chr(34)
Page.Response.Write("<script language=" + Chr(34) + "Javascript" + Chr(34) +
">")
Page.Response.Write("showModelessDialog(" + Chr(34) + "popupphonedata.aspx"
+ Chr(34) + "," + Chr(34) + Chr(34) + "," + sFeatures + ")")
Page.Response.Write("</script>")

On the popupphonedata.aspx page I have a button that has this code:

Dim msg As String
msg = msg & "<Script Language='JavaScript'>"
msg = msg & "window.close();"
msg = msg & "</Script>"
Page.Response.Write(msg)

When I click on the button, the window is not closed.
I seems almost that it is closed and then re-opened because of the script in
the main page.
How can I remove/de-activate that script after it is executed?

rg,
Eric
Nov 18 '05 #1
3 1436
Hi,
In the popupphonedata.aspx try replacing the code with this
Dim msg As String
msg = msg & "<Script Language='JavaScript'>"
msg = msg & "function CloseWindow(){"
msg = msg & "window.close();"
msg = msg & "return false;}"
msg = msg & "</Script>"
Page.RegisterClientScriptBlock("startUp", msg)
Button1.Attributes.Add("OnClick", "return CloseWindow()")
where Button1 is the button on clicking which you want to close the window.
--
The best
srini
"EMW" wrote:
In my ASPX page I have the following code behind which is activated when the
user clicks on a linkbutton:

Dim sFeatures As String = Chr(34) +
"DiaglogHeigth:50px;DialogWidth:412px;center:yes;h elp:no;resizable:no;scroll
:no;status:no;" + Chr(34)
Page.Response.Write("<script language=" + Chr(34) + "Javascript" + Chr(34) +
">")
Page.Response.Write("showModelessDialog(" + Chr(34) + "popupphonedata.aspx"
+ Chr(34) + "," + Chr(34) + Chr(34) + "," + sFeatures + ")")
Page.Response.Write("</script>")

On the popupphonedata.aspx page I have a button that has this code:

Dim msg As String
msg = msg & "<Script Language='JavaScript'>"
msg = msg & "window.close();"
msg = msg & "</Script>"
Page.Response.Write(msg)

When I click on the button, the window is not closed.
I seems almost that it is closed and then re-opened because of the script in
the main page.
How can I remove/de-activate that script after it is executed?

rg,
Eric

Nov 18 '05 #2
EMW
Thanks, but now the main window is closing and the one that should be closed
is maximized.

I must be doing something wrong....

rg,
Eric

"srini" <sr***@discussions.microsoft.com> schreef in bericht
news:33**********************************@microsof t.com...
Hi,
In the popupphonedata.aspx try replacing the code with this
Dim msg As String
msg = msg & "<Script Language='JavaScript'>"
msg = msg & "function CloseWindow(){"
msg = msg & "window.close();"
msg = msg & "return false;}"
msg = msg & "</Script>"
Page.RegisterClientScriptBlock("startUp", msg)
Button1.Attributes.Add("OnClick", "return CloseWindow()")
where Button1 is the button on clicking which you want to close the window. --
The best
srini
"EMW" wrote:
In my ASPX page I have the following code behind which is activated when the user clicks on a linkbutton:

Dim sFeatures As String = Chr(34) +
"DiaglogHeigth:50px;DialogWidth:412px;center:yes;h elp:no;resizable:no;scroll :no;status:no;" + Chr(34)
Page.Response.Write("<script language=" + Chr(34) + "Javascript" + Chr(34) + ">")
Page.Response.Write("showModelessDialog(" + Chr(34) + "popupphonedata.aspx" + Chr(34) + "," + Chr(34) + Chr(34) + "," + sFeatures + ")")
Page.Response.Write("</script>")

On the popupphonedata.aspx page I have a button that has this code:

Dim msg As String
msg = msg & "<Script Language='JavaScript'>"
msg = msg & "window.close();"
msg = msg & "</Script>"
Page.Response.Write(msg)

When I click on the button, the window is not closed.
I seems almost that it is closed and then re-opened because of the script in the main page.
How can I remove/de-activate that script after it is executed?

rg,
Eric

Nov 18 '05 #3
Which page did you put the JavaScript in? It will close the browser of the
one it runs in.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"EMW" <SomeOne@MicroSoftdotCom> wrote in message
news:40**********************@dreader2.news.tiscal i.nl...
Thanks, but now the main window is closing and the one that should be closed is maximized.

I must be doing something wrong....

rg,
Eric

"srini" <sr***@discussions.microsoft.com> schreef in bericht
news:33**********************************@microsof t.com...
Hi,
In the popupphonedata.aspx try replacing the code with this
Dim msg As String
msg = msg & "<Script Language='JavaScript'>"
msg = msg & "function CloseWindow(){"
msg = msg & "window.close();"
msg = msg & "return false;}"
msg = msg & "</Script>"
Page.RegisterClientScriptBlock("startUp", msg)
Button1.Attributes.Add("OnClick", "return CloseWindow()")
where Button1 is the button on clicking which you want to close the window.
--
The best
srini
"EMW" wrote:
In my ASPX page I have the following code behind which is activated when the
user clicks on a linkbutton:

Dim sFeatures As String = Chr(34) +

"DiaglogHeigth:50px;DialogWidth:412px;center:yes;h elp:no;resizable:no;scroll :no;status:no;" + Chr(34)
Page.Response.Write("<script language=" + Chr(34) + "Javascript" +

Chr(34) + ">")
Page.Response.Write("showModelessDialog(" + Chr(34) + "popupphonedata.aspx" + Chr(34) + "," + Chr(34) + Chr(34) + "," + sFeatures + ")")
Page.Response.Write("</script>")

On the popupphonedata.aspx page I have a button that has this code:

Dim msg As String
msg = msg & "<Script Language='JavaScript'>"
msg = msg & "window.close();"
msg = msg & "</Script>"
Page.Response.Write(msg)

When I click on the button, the window is not closed.
I seems almost that it is closed and then re-opened because of the script in the main page.
How can I remove/de-activate that script after it is executed?

rg,
Eric


Nov 18 '05 #4

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

Similar topics

4
by: John H. | last post by:
Hello I have some trouble in closing a window, Here is the problem: I develop a asp.net website use client side valiation <asp:CustomValidator id="CustomValidator1"...
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...
5
by: Matt Kruse | last post by:
See: http://www.mattkruse.com/temp/window_closed.html It looks like the .closed property of a window is inaccessible if the window is actually closed. Other browsers have no problem detecting...
9
by: Graham | last post by:
What I currently have is a page that opens another browser at 800x600, once that is loaded I would like to close the orginal page down while keeping the page that it has just opened open (To make...
2
by: Matt | last post by:
When the user click the "Close Application" button, it will close the window. That window is not called by window.open(...) before. However, when it calls window.close(), it pops up an dialog...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
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 ...
0
by: Tom wilson | last post by:
Yes, I'm absolutely serious. I'm in the VS.Net editor with an HTML page loaded. All the links are broken. So I right click an image and choose Properties. The window appears. No matter...
2
by: David | last post by:
I'm opening a cmd window to run an ftp process. It's easy enough to close the process (.close()), but the cmd window won't close unless I go out to the window and type 'quit'. How can I send a...
3
by: EnjoyNews | last post by:
I have a popup problem. I have a script that generates a popup for image viewing. It has 2 function, and the first is that it automaticly generates the popup window to the size of the image,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.