How to Close Browser Window from Silverlight Application? - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Monday, August 8, 2011

How to Close Browser Window from Silverlight Application?

All most all secured sites like bank websites asks you to close your browser window after you signed out from the web application. This is due to high security which actually removes all session details from the browser cache.   If you want to develop the same behavior in your Silverlight application, how will you do this? This post covers the code to implement the functionality of the same. Read to know more.     If you are developing a secured site and want to close the browser window just after the user logout from the application, this small tip will help you. This is not a difficult job to implement. Just a single line of code will do the trick for you.   Use "System.Windows.Browser.HtmlPage.Window.Invoke()" method to call the Close() method of the browser window as shown in the below code snippet:   private void OnCloseClick(object sender, RoutedEventArgs e) { ...

No comments:

Post a Comment