开发者

Session Timeout Redirect to Login Page in Silverlight

HI,

I am maintaing Session in Silverlight App via webservice(WCF). Now i want to redirect to login page when user is idle for 2 minutes/session expires(After 2 minute).

Currently i am doing like this :

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)
        {



Session开发者_StackOverflowService.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;
       }

What to do after this step ?


App.Current.RootVisual = new LoginPage();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜