如何在超时时将 Silverlight 应用程序重定向到 ASP.NET 登录页



我的 Silverlight 5 应用程序托管在具有 5 分钟超时的 FormAuthentication 的 ASP.NET 站点中。我有一个客户端要求,当会话超时发生时,必须将下一个用户请求重定向到登录.aspx然后再次登录。

目前我在处理程序中有这个Application_UnhandledException

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

谢谢埃利奥

你可以尝试 - 基于Navigate Method

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

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

最新更新