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

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 3465
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.setTimeout("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.googlegro ups.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**************@TK2MSFTNGP04.phx.gbl...
<script>
Change this to:

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

window.setTimeout("TimeOut();", 900000);
Apr 17 '07 #3
On Apr 17, 3:25 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
"George Ter-Saakov" <gt-...@cardone.comwrote in message

news:eC**************@TK2MSFTNGP04.phx.gbl...
<script>

Change this to:

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

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

window.setTimeout("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...@markNOSPAMrae.netwrote:
"George Ter-Saakov" <gt-...@cardone.comwrote in message

news:eC**************@TK2MSFTNGP04.phx.gbl...
<script>

Change this to:

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

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

window.setTimeout("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.googlegr oups.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.CacheControl = "no-cache";

Response.Expires = -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.googlegr oups.com...
On Apr 17, 3:25 pm, "Mark Rae" <m...@markNOSPAMrae.netwrote:
>"George Ter-Saakov" <gt-...@cardone.comwrote in message

news:eC**************@TK2MSFTNGP04.phx.gbl...
<script>

Change this to:

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

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

window.setTimeout("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
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 =...
10
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...
3
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....
1
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...
3
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...
1
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...
0
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...
4
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
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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.