Silverlight-与服务器交互 [英] Silverlight - Interacting with the server

查看:69
本文介绍了Silverlight-与服务器交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


如果Silverlight是客户端框架,并且用于开发Web应用程序,那么它如何与服务器交互.如果我正在Silverlight中开发一个还处理SQL Server的网站,它将如何回发到服务器?

Hi,
If silverlight is client side framework and it is used for developing web applications, then how does it interact with the server. If I am developing a web site in silverlight which also deals with the SQL server, How will it postback to the server?

推荐答案

您必须使用Web服务进行交互与Silverlight中的数据库一起使用.此链接应该开始您:

http://msdn.microsoft.com/en-us/library/cc197940 (v = vs.95).aspx [
You MUST use a web service to interact with a database from Silverlight. This link should get your started:

http://msdn.microsoft.com/en-us/library/cc197940(v=vs.95).aspx[^]


尽管应用程序是从客户端运行的,但是它将始终与服务器一起运行.并与服务器异步交互,而不是每次使用ASP.Net机制时都加载并请求页面.

您可以使用名为
fiddler [ ^ ]可以在SL应用每次请求服务器时监视.

有关Silverlight应用程序生命周期的更多信息,您可以参考 MSDN [
Though Application is running from client side but It will always be live with the server. And interacts with server Asynchronously rather then loading and requesting page each time you are doing with ASP.Net mechanism.

You could use tool called fiddler[^] to have a watch every time SL apps requesting to server.

And for more information regarding silverlight App lifecycle you could refer MSDN[^].


添加一个托管Silverlight应用程序的网站的WCF服务.

然后在Silverlight代码中,将服务引用添加到WCF服务.

Google:从silverlight调用wcf

为您提供了大量教程等.
Add a WCF service to the website hosting the Silverlight app.

Then in the silverlight code, add a service reference to the WCF service.

Google: calling wcf from silverlight

gives you plenty of tutorials etc.


这篇关于Silverlight-与服务器交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆