Silverlight与主机.aspx页面之间的服务器端事件

时间:2022-03-23 15:36:55

Is it possible to set up a listener in a Silverlight control to listen for events on the hosting aspx web page? I want to have several Silverlight and ASP.NET user controls hosted in a web page. I want to fire an event on one user control, sending an event to the host page (it needs to be notified), and then I want to broadcast an event back to all controls (both Silverlight and ASP.NET) on the form. This this possible to do with Silverlight?

是否可以在Silverlight控件中设置侦听器以侦听托管aspx网页上的事件?我希望在网页中托管多个Silverlight和ASP.NET用户控件。我想在一个用户控件上触发事件,将事件发送到主机页面(需要通知),然后我想将事件广播回窗体上的所有控件(包括Silverlight和ASP.NET)。这可能与Silverlight有关吗?

2 个解决方案

#1


Silverlight is a client side technology. It can interact with the DOM and it can listen to DOM events, but it can't interact with the ASP.NET controls or listen to events from them.

Silverlight是一种客户端技术。它可以与DOM交互,它可以监听DOM事件,但它不能与ASP.NET控件交互或从它们监听事件。

#2


Silverlight is a client-side technology. You are allowed though to call Javascript functions. Having that, you can take advantage of the ASP.NET AJAX to make calls to web methods on the host ASPX page. Even better, you can force a full post-back of the ASPX page from Javascript.

Silverlight是一种客户端技术。你被允许调用Javascript函数。有了这个,您可以利用ASP.NET AJAX在主机ASPX页面上调用Web方法。更好的是,您可以从Javascript强制完整回发ASPX页面。

(sorry for the late response. i've just come accross this when looking for something else)

(对不起迟到的回复。我只是在寻找其他东西时才会遇到这种情况)

#1


Silverlight is a client side technology. It can interact with the DOM and it can listen to DOM events, but it can't interact with the ASP.NET controls or listen to events from them.

Silverlight是一种客户端技术。它可以与DOM交互,它可以监听DOM事件,但它不能与ASP.NET控件交互或从它们监听事件。

#2


Silverlight is a client-side technology. You are allowed though to call Javascript functions. Having that, you can take advantage of the ASP.NET AJAX to make calls to web methods on the host ASPX page. Even better, you can force a full post-back of the ASPX page from Javascript.

Silverlight是一种客户端技术。你被允许调用Javascript函数。有了这个,您可以利用ASP.NET AJAX在主机ASPX页面上调用Web方法。更好的是,您可以从Javascript强制完整回发ASPX页面。

(sorry for the late response. i've just come accross this when looking for something else)

(对不起迟到的回复。我只是在寻找其他东西时才会遇到这种情况)