473,799 Members | 3,163 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to kill a web page?

Hi,

I have an ASP.Net web page that has a timer that needs to be killed
when the timer fires off. How can I do this from the master.page?

Thanks
Steve

Apr 17 '07 #1
6 3485
Kill is a bad word :)
My guess you want to log user out after some timeout?

Simply have your master.page to output following JavaScript

<script>
function TimeOut()
{
window.location ="/logout.aspx"
}
window.setTimeo ut("TimeOut();" , 15 minutes);

See help on setTimeout function in Javascript (not in .NET).

<script>
George.


"Steve Kershaw" <st***********@ yahoo.comwrote in message
news:11******** **************@ y5g2000hsa.goog legroups.com...
Hi,

I have an ASP.Net web page that has a timer that needs to be killed
when the timer fires off. How can I do this from the master.page?

Thanks
Steve

Apr 17 '07 #2
"George Ter-Saakov" <gt****@cardone .comwrote in message
news:eC******** ******@TK2MSFTN GP04.phx.gbl...
<script>
Change this to:

<script type="text/javascript">
window.setTimeo ut("TimeOut();" , 15 minutes);
This will throw an exception because the second argument of the
window.setTimeo ut method requires an integer value denoting the number of
milliseconds to delay:

window.setTimeo ut("TimeOut();" , 900000);
Apr 17 '07 #3
On Apr 17, 3:25 pm, "Mark Rae" <m...@markNOSPA Mrae.netwrote:
"George Ter-Saakov" <gt-...@cardone.com wrote in message

news:eC******** ******@TK2MSFTN GP04.phx.gbl...
<script>

Change this to:

<script type="text/javascript">
window.setTimeo ut("TimeOut();" , 15 minutes);

This will throw an exception because the second argument of the
window.setTimeo ut method requires an integer value denoting the number of
milliseconds to delay:

window.setTimeo ut("TimeOut();" , 900000);
Is there anyway to logout someone or drop the Web Page in C#???
Steve

Apr 18 '07 #4
On Apr 17, 3:25 pm, "Mark Rae" <m...@markNOSPA Mrae.netwrote:
"George Ter-Saakov" <gt-...@cardone.com wrote in message

news:eC******** ******@TK2MSFTN GP04.phx.gbl...
<script>

Change this to:

<script type="text/javascript">
window.setTimeo ut("TimeOut();" , 15 minutes);

This will throw an exception because the second argument of the
window.setTimeo ut method requires an integer value denoting the number of
milliseconds to delay:

window.setTimeo ut("TimeOut();" , 900000);
That worked! But I can still click the back button and return to the
previous page which is a problem here!!! If the timeout happends then
the current page must either be "killed" or the new page must not have
any reference BACK to the old page!

Thanks again for your help.

Steve

Apr 18 '07 #5
"Steve Kershaw" <st***********@ yahoo.comwrote in message
news:11******** **************@ y80g2000hsf.goo glegroups.com.. .
That worked! But I can still click the back button and return to the
previous page which is a problem here!!! If the timeout happends then
the current page must either be "killed" or the new page must not have
any reference BACK to the old page!
Despite what some people will tell, there is really no 100% reliable way of
disabling the back button...
Apr 18 '07 #6
You can add following code to your every page
Response.CacheC ontrol = "no-cache";

Response.Expire s = -1;

Theoretically that prevents caching and if user clicks back button browser
forced to send a request to the server (which in turn should redirect user
to login page if Session has expired)

worked for me although I did not do extensive testing with all browsers that
out there.

George.

"Steve Kershaw" <st***********@ yahoo.comwrote in message
news:11******** **************@ y80g2000hsf.goo glegroups.com.. .
On Apr 17, 3:25 pm, "Mark Rae" <m...@markNOSPA Mrae.netwrote:
>"George Ter-Saakov" <gt-...@cardone.com wrote in message

news:eC******* *******@TK2MSFT NGP04.phx.gbl.. .
<script>

Change this to:

<script type="text/javascript">
window.setTimeo ut("TimeOut();" , 15 minutes);

This will throw an exception because the second argument of the
window.setTime out method requires an integer value denoting the number of
milliseconds to delay:

window.setTime out("TimeOut(); ", 900000);

That worked! But I can still click the back button and return to the
previous page which is a problem here!!! If the timeout happends then
the current page must either be "killed" or the new page must not have
any reference BACK to the old page!

Thanks again for your help.

Steve

Apr 19 '07 #7

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

Similar topics

10
7445
by: Vilmar Brazão de Oliveira | last post by:
HI people, what is wrong in the code bellow to kill iexplore.exe process after processing my page?? '»»Before comes routines to access data base and to send email. Set objWshell = Server.CreateObject("WScript.Shell") objWshell.Run "%COMSPEC% /C kill iexplore.exe", 0, TRUE VILMAR BRAZIL
10
9785
by: Fred | last post by:
There is a setting in INIT.ORA that has the unintended side-effect of making sure the ALTER SYSTEM KILL SESSION command has immediate affect. Without this setting, I've seen some instances where the session reports as being KILLED in V$SESSION but is not physically removed until the instance is bounced. Does anyone remember this value offhand?
3
4443
by: MeAgain | last post by:
Hi I have an external website link on my webpage which open like all the link in TARGET frame. since last week the external link vendor put script in his page which refresh and remove my frame. How can I kill this script so it stays in my target frame??? thanks the script is as below. """ <script language="JavaScript">
1
2555
by: Mohammad Samara | last post by:
Hello everyone, Is it possible to kill the Application session on website leave event? i.e using "FormsAuthentication.SignOut()" when changing the web site by entering a different domain name in the address bar on Internet explorer. Thanks.
3
3337
by: hari krishna | last post by:
hi, I am generating excel reports through vb.Net. After creating excel.application and the report is generated, each report leaves Excel in memory. I can see them in task manager in Process tab (as EXCEL). So the memory has been taken by excel objects and memory is being full. i want to delete or kill this objects which are in memory. i wrote the code as 'myexcel.quit()' , myexcel=nothing. but still it is in memory. pls tell me how to...
1
3602
by: Lee Gillie | last post by:
I need to be able to kill a process programmatically under ASP.NET. IIS runs under the local system account. The user accessing the web is using anonymous access. We would prefer NOT to grant elevated security to the proxy used for anonymous access. Is there a way to either establish a temporary security context, programmatically for the .NET Framework Process.Kill to operate under? Or perhaps a way to give the compiled binary produced...
0
1063
by: __Beat__ | last post by:
Ho to kill a page? When calling my .NET 2.0 DLL from a page, I pass a reference to the page in the NEW: MyDLL = new MyClass(Page,Context) New Sets a global Variable that is then referenced in various procedures in MyClass. Along the processing, I figured out, that MyClass lost the reference to the Page.
4
1143
by: David Thielen | last post by:
Hi; If I want to kill my asp.net application (the license check fails), how can I do that? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
18
10246
by: =?Utf-8?B?VGhlU2lsdmVySGFtbWVy?= | last post by:
Because C# has no native SSH class, I am using SharpSSH. Sometimes, for reasons I do not know, a Connect call will totally lock up the thread and never return. I am sure it has something to do with weirdness going on with the server I am talking to. Anyhow, this locked up state happens once in a while (maybe once per day) and I can't figure out how to deal with the locked up thread. If I issue a Thread.Abort() the exception never...
0
9686
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
9540
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
10475
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
10250
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
7564
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
6805
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();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
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

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.