473,811 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

force close the aspx page.

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

Thanks :)
Nov 19 '05 #1
3 4416
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******** *****@TK2MSFTNG P15.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
2634
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 to notify the user to click Okay to save the work now OR click cancel to refresh the page. What if the user doesn't respond to the dialog box for a long time and then hits save? Well the session has already timed out! So, can I have the dialog...
3
1452
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) + "DiaglogHeigth:50px;DialogWidth:412px;center:yes;help: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)...
1
1928
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 masterzones which in turn have subzones which in turn have modules. (sound familiar!!) when a request is received an httpmodule looks at the hostname to determine which portal the request is for before working out which page is being requested and...
8
16550
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. Does anyone know if/how this can be done?
5
5522
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 .Net non-CF that you can do something like System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls; but that does not sem to be supportted on CF. Thank you! string stream = ...
11
4950
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 closes. That's all you see. TSReminder.aspx doesn't even open. I'm not sure what's going on here. Response.Write("<script...
1
2061
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 page2.aspx and close it with Javascript.window.close(), the page1.aspx does not postback ? Any idea how can I force the page1.aspx to PostBack. Best Regards,
1
5641
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 works fine the first time you load A.aspx. however, on subsequent times--with changed session variables--A.aspx is the same, as is B.aspx, if you check it. However, B.aspx is not really the same, since if you refresh the browser, B.aspx will then...
2
3829
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 with PgB, they click a button that executes this VB: Protected Sub Close_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Close.Click 'Do some stuff Response.Write("<script language='javascript'{...
0
9734
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
9607
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
10137
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
9211
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...
1
7673
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
5700
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4346
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
2
3874
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3026
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.