开发者

How to raise an Event in asp.net application from a silverlight application

I have a Silverlight application hosted inside an asp.net website. In my silverlight applic开发者_如何学JAVAaiton, if I select a theme. Then, theme changes will gets fired. I want to get notified in asp.net web page, when the theme changed event is fired inside the silverlight application.

Note: Also, I don't want to use a data base to maintain the state of the application.


You can't easily raise an asp.net application event from your Silverlight App. It should be possible, but would require your SL app to do a POST request on the server with POST parameters interfacing well with the ASP.NET plumbing. It's hacking, I would say that's not the recommended way to do it and if you do it asynchronously (without reloading the page), it could do weird things with your viewstate.

You can however call a web service from the SL app when the user change the theme. (the webservice could be something as simple as a request handler or an aspx page with get parameters or maybe a WCF service)

You could then store values about the selected theme in the user session.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜