简体   繁体   English

在调用Web服务的自定义ASP.NET Web控件中使用AJAX / Jquery

[英]Using AJAX/Jquery with custom ASP.NET web controls that call a web-service

I've written a simple ascx user control called myLight that I programtically add several instances of this control to my form. 我编写了一个名为myLight的简单ascx用户控件,以编程方式将该控件的多个实例添加到表单中。 This control has two buttons ON and OFF , and it has an "ID" property 该控件具有两个按钮ONOFF ,并且具有“ ID”属性

I also have a WCF webservice which has two methods ON and OFF as well as a Status function. 我也有一个WCF Web服务,它有两种方法ONOFF以及Status函数。

So the page will be setup with several instances of myLight and each instance will have a unique address. 因此,该页面将设置有多个myLight实例,并且每个实例将具有唯一的地址。 When the user clicks an ON/OFF button, the appropriate web-service will be called with the address for the control clicked. 当用户单击“开/关”按钮时,将使用单击控件的地址来调用相应的Web服务。 However I don't want the entire page to have to reload after each button press, rather just call the web-service. 但是,我不希望每次按下按钮后都必须重新加载整个页面,而只是调用Web服务。

After I get this part working, I'd like for each control to periodically call the Status function with its address so that it can update the color of the control, depending upon the return value. 在使该部分正常工作之后,我希望每个控件定期使用其地址来调用Status函数,以便它可以根据返回值更新控件的颜色。

I'm looking for suggestions on how to implement this. 我正在寻找有关如何实现此目标的建议。 AJAX server controls, JQuery, etc. AJAX服务器控件,JQuery等

to show you whole concept here is little long and tedious process so,for implementing ajax enabled wcf service, take a look at following link... 在这里向您展示整个概念是一个漫长而乏味的过程,因此,要实现启用了Ajax的wcf服务,请查看以下链接...

http://www.dotnetcurry.com/ShowArticle.aspx?ID=235 http://www.dotnetcurry.com/ShowArticle.aspx?ID=235

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM