Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
2 webform questions
Message
General information
Forum:
ASP.NET
Category:
Web forms
Miscellaneous
Thread ID:
00675854
Message ID:
00676369
Views:
14
This message has been marked as a message which has helped to the initial question of the thread.
Keep in mind that if you attempt to close a browser window in script code that your code did not open originally, the browser will prompt the user if it's okay to close the window before it will actually close. This is one of the security features of IE but other browsers do similar things as well.

Have fun,
-B

>Kirk,
>
>I response to #2 below here is the code to close the browser from a button:
>
>
>Private Sub Button1_Click
>(ByVal sender As System.Object, ByVal e As System.EventArgs)
>Handles Button1.Click
>   ' perform other server side tasks here
>   Response.Write("<script>window.close();</script>")
>End Sub
>
>
>As far is #1 is concerned, session end happens in the server without any user request. So there is no object at all for you to redirect or Transfer, or anything that's related to a client request.
>
>
>>#1: How can I detect when a session expires, and then move the user to a page that shows the session has expired? I put the following code in the global.asax file:
>>
>>
>>    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
>>        ' Fires when the session ends
>>        Server.Transfer("SessionExpired.aspx")
>>    End Sub
>>
>>
>>But nothing ever happened. I haven't changed any default settings and I think I read that by default the session expires after twenty minutes.
>>
>>
>>#2: Kinda of related. Is it possible to close the browser? For example. I have a employee screen. If they click the logoff button I'd like to close the browser. Right now I send them back to the login in screen.
>>
>>Thanks
>>Kirk
Beth Massi
Program Manager
Visual Studio Community
Microsoft Corporation
http://blogs.msdn.com/bethmassi
http://mdsn.com/vbasic
Previous
Reply
Map
View

Click here to load this message in the networking platform