开发者

How to maintain state in silverlight?

When I resize my aspx page hosting the silverlight app, I l开发者_运维百科ose state on all silverlight controls. How do I maintain state on silverlight controls?


I'm not sure what precisely you're doing, but under normal circumstances, you should be able to resize your page without doing a page refresh, and hence, without losing state in your Silverlight controls. Are you doing something that's causing a page refresh? If so, yes, that would cause you to lose state. And if that's the case, and you really do need the round-trip back to the server, then you'll need to store your state somewhere else, for instance, in the ASPX page ViewState, or on a web service, or in your local Silverlight storage. But my guess is that you don't actually need the round-trip to the server, i.e., that it's being caused by a side-effect of something else you're doing. I'd start there.


I had this problem too, becuase I'm using a Telerik RadWindow, resizing, reloads the Silverlight app and then you lose the state. If you are using something similar, turn of ReloadOnShow or don't allow resize of the window

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜