I am building a SL4 application that uses the standard authentica开发者_运维问答tion built into the business template. The user logs in and is then redirected to a new page. If the user then refreshes that page, the WebContext.Current.User returns null. Why does this happen? Thanks
Probably, you are handling your authentication context inside the Silverlight application, and when the page is refreshed, a new Silverlight application is instantiated and therefore a new authentication context is created, on which the user has not provided credentials yet. In order to prevent this it is necessary for you to move the authentication context to an upper layer, at the browser and authenticate using a server side technology like ASP.NET and have Silverlight leverage that authentication context instead of handling its own context.
精彩评论