Friday, September 21, 2012

How to redirect a Silverlight application to ASP.NET login page on timeout?

How to redirect a Silverlight application to ASP.NET login page on timeout?

I have a requirement in my Silverlight 5 app hosted in an ASP.NET site with FormAuthentication with 5 min timeout. I have a client requirement that when the session timeout occurs the next user request must be redirected to login.aspx and login again.

Currently I have this in Application_UnhandledException handler:

if (domainException != null && !WebContext.Current.User.IsAuthenticated) {     e.Handled = true;     System.Windows.Browser.HtmlPage.Document.Submit(); // redirect to login page } 

Thanks Elio

Answers & Comments...

Answer: 1

You can try with - based on Navigate Method

System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("url", UriKind.Absolute)); 

Link : http://msdn.microsoft.com/fr-fr/library/cc189809(v=vs.95).aspx

by : Aghilas Yakoubhttp://stackoverflow.com/users/1036390




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog