会话超时重定向到Silverlight中的登录页面

时间:2011-04-08 12:33:22

标签: silverlight wcf

HI,

我通过webservice(WCF)维护Silverlight App中的Session。 现在我想在用户空闲2分钟/会话到期时(2分钟后)重定向到登录页面。

目前我这样做:

WCF:

 [OperationContract]
        public int GetSessionTimeOut()
        {
            return HttpContext.Current.Session.Timeout;
        }

web.config:

<sessionState timeout ="2" ></sessionState>

Page.xaml.cs

void Welcome_Loaded(object sender, RoutedEventArgs e)
        {



SessionService.SLWebServiceClient client = new SessionService.SLWebServiceClient();
                client.GetSessionTimeOutCompleted += new EventHandler<SessionService.GetSessionTimeOutCompletedEventArgs>(client_GetSessionTimeOutCompleted);
                client.GetSessionTimeOutAsync(); 


        }

        void client_GetSessionTimeOutCompleted(object sender, SessionService.GetSessionTimeOutCompletedEventArgs e)
        {
            int result = e.Result;
       }

此步骤后该怎么办?

1 个答案:

答案 0 :(得分:0)

App.Current.RootVisual = new LoginPage();

相关问题