You can get some ideas from Scott Mitchell's article here: 
http://aspnet.4guysfromrolla.com/articles/042005-1.aspx
----- Original Message ----- 
From: "Eva Li" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, May 27, 2005 2:41 PM
Subject: Re: [AspNetAnyQuestionIsOk] How Do I prevent user to close the 
browser?


> Dean,
>
> So it looks like that I can not solve my problem below:
>
> Ineed to know in my ASP.NET app that when user close browser.
> I can use onunload event in _JavaScript. Problem is that onunload
> is called during a refresh or a link to other page is clicked. When
> the window is closed I need to call my Logout function to write the
> time that the user leaves and I need to do this in my server side code.
> This should only be when the Browser window is closed and not
> refreshed or other link clicked.
>
> Dean Fiala <[EMAIL PROTECTED]> wrote:
> You can't.
>
> On 5/27/05, Eva Li <[EMAIL PROTECTED]> wrote:
>>
>> How to disable the Exit button in browser?
>>
>> In my app, after use logs in, I'd like them to click log out to get out
>> instead of closing browser. Does anybody know how to do this?
>>
>> Thanks!
>>
>> Eva
>>
>>
>> [EMAIL PROTECTED] wrote:Use a JavaScript function in all hyperlinks to 
>> replace the location.
>> This technique will prevent the user from using foward and back buttons
>> on all but the first page of the a website.
>>
>> Go to http://www.martindb.com/demos/page1.htm
>>
>> Check out the "view source" for each page.
>>
>> The <BACK> button on the browser will point to the last URL before 
>> entering my
>> website.
>>
>> Dallas Martin
>>
>> Quoting Eva Li <[EMAIL PROTECTED]>:
>>
>> > I thought that back button and referesh button could be disabled.
>> >
>> > I may use this in one of my clients app.
>> >
>> > Eva
>> >
>> > Peter Brunone <[EMAIL PROTECTED]> wrote:
>> >
>> >    Well, first you'd have to remove the Refresh button in the browser, 
>> > so
>> > you'd need to open a new window without that toolbar.  Then you'd need 
>> > to
>> > intercept the CTRL-R key combo and F5 key.  Then you'd need to disable 
>> > the
>> > right-click function that brings up a context menu including Refresh.
>> >
>> >    All that *might* work, but if a user disables Javascript, you're 
>> > back
>> > where you started.
>> >
>> >    Why are you trying to do this?
>> >
>> > From: Eva Li [EMAIL PROTECTED]
>> >
>> > I'd like to prevent user from refreshing a page. Can any one please
>> > let me know how to do this either in my code behind or using javascript
>> > in my aspx page?
>> >
>> > Thanks!
>> >
>> > Eva
>> >
>> >
>> > [Non-text portions of this message have been removed]
>> >
>> >
>> >
>> > ---------------------------------
>> > Yahoo! Groups Links
>> >
>> >    To visit your group on the web, go to:
>> > http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>> >
>> >    To unsubscribe from this group, send an email to:
>> > [EMAIL PROTECTED]
>> >
>> >    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>> >
>> >
>> >
>> > [Non-text portions of this message have been removed]
>> >
>> >
>> >
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>>
>>
>> ---------------------------------
>> Yahoo! Groups Links
>>
>>    To visit your group on the web, go to:
>> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>>
>>    To unsubscribe from this group, send an email to:
>> [EMAIL PROTECTED]
>>
>>    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>>
>>
>>
>>
>> [Non-text portions of this message have been removed]
>>
>>
>>
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>
>
> -- 
> Dean Fiala
> Very Practical Software, Inc
> http://www.vpsw.com
>
>
> ---------------------------------
> Yahoo! Groups Links
>
>   To visit your group on the web, go to:
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
>
>   To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
>
>   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> 





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to