0

I've written a simple ascx user control called myLight that I programtically add several instances of this control to my form. This control has two buttons ON and OFF, and it has an "ID" property

I also have a WCF webservice which has two methods ON and OFF as well as a Status function.

So the page will be setup with several instances of myLight and each instance will have a unique address. When the user clicks an ON/OFF button, the appropriate web-service will be called with the address for the control clicked. However I don't want the entire page to have to reload after each button press, rather just call the web-service.

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.

I'm looking for suggestions on how to implement this. AJAX server controls, JQuery, etc.

6
  • First question, does your WCF service live in the same domain as the web site? Commented Mar 13, 2012 at 15:52
  • You're doing it the hard way with WCF. For http web services, use .asmx or Web API. Commented Mar 13, 2012 at 16:42
  • @jrummell - I can't believe you actually just suggested that somebody use .asmx Commented Mar 13, 2012 at 17:47
  • Yes the service lives in the same domain... and I am actually using an asmx service for this test application Commented Mar 13, 2012 at 17:52
  • @Josh believe it. It's dead simple compared to http/WCF. Check out the articles I linked to learn more. Commented Mar 13, 2012 at 17:55

1 Answer 1

1

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...

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

Sign up to request clarification or add additional context in comments.

1 Comment

This is getting me there. The only issue I have at this point is that the user controls are all referring to the same javascript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.