473,387 Members | 3,033 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,387 software developers and data experts.

force close the aspx page.

Hello,
How can I close the aspx by force (with some commands) ?

Thanks :)
Nov 19 '05 #1
3 4399
client side javascript

window.close();

Once the page has been delivered to the browser. The server
cannot send a command to it until the client sends another request.

So, you have to do this client side in some fashion.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net

"Eitan" <no****@nospam.com> wrote in message
news:uM*************@TK2MSFTNGP15.phx.gbl...
Hello,
How can I close the aspx by force (with some commands) ?

Thanks :)

Nov 19 '05 #2
What I did,
on page_load event, I added the code :

Dim btn As Button

btn = CType(btnOK, Button)

btn.Attributes.Add("onclick", _

String.Format("window.close();"))

Dialog truely close, thanks.

(so there are event onclick on the client, and onclick on the server).

One problem is that just after closing the dialog,

the contents of the dialog appear in a new window (In IE web browser),

Which I don't want that this will happen.

What may be wrong ?

Thanks :)
Nov 19 '05 #3
What I did,
on page_load event, I added the code :

Dim btn As Button

btn = CType(btnOK, Button)

btn.Attributes.Add("onclick", _

String.Format("window.close();"))

Dialog truely close, thanks.

(so there are event onclick on the client, and onclick on the server).

One problem is that just after closing the dialog,

the contents of the dialog appear in a new window (In IE web browser),

Which I don't want that this will happen.

What may be wrong ?


Also I don't want that on_load event occurs just after pressing the
server-side button.

Thanks :)
Nov 19 '05 #4

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

Similar topics

1
by: Piyush Parmar | last post by:
Hi. I would like to know if it's possible to force a dialog box to "expire" after so many seconds? The scenario is that I'm holding various objects in my session. Before it times out, I want...
3
by: EMW | last post by:
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) +...
1
by: london calling | last post by:
Hi everyone, I am developing an application which uses custom httpmodules and httphandlers to display 'portaled' content. (asp.net 1.1) The front end consists of aspx templates which contain...
8
by: Keith H | last post by:
I'm looking for a way to force the user to re-authenticate with their Windows username/password/domain after clicking the submit button on an ASP.NET page. This is for an internal application. ...
5
by: devgrt | last post by:
<--> We post some xml to https as shown below. The server supports SSL 3.0 and TLS. We wnat to force the PocketPC 2003 application to only use TLS for FIPs compliance. Is that possible? I see in...
11
by: Dave | last post by:
For some reason, the below lines only work on select machines. All machines are running IE6. IE SP's and OS's vary. When it doesn't work, default.aspx (the page that this code is in) opens and...
1
by: Luqman | last post by:
I have created a page1.aspx with a button, when I click on button, page2.aspx is opened on top of page1.aspx as a New Popup Window using Javascript Window.Open. Now, when I select the data on...
1
by: William LaMartin | last post by:
I have an aspx page, A.aspx, that uses some xml. The source of the xml is another aspx page, B.aspx. B.aspx is populated with xml by code that depends on several Session variables. This all...
2
by: =?Utf-8?B?U2lsa0NpdHlGbG9yaWRh?= | last post by:
I have a web page "PgA" with a GridView. I open another page "PgB" in a new window. On PgB, they do some things that affect the underlying data for the GridView on PgA. When the user is done...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...

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.