C# – Custom web server control fails when calling a web service

ccustom-server-controlsweb services

I've created a web server control, it works fine. Problems start when I try calling an external web service. I am using a script manager and it's directed to the following location –> http:\localhost\UserNamesData.asmx.

My server control creates some html controls as well some javascript code. When the user clicks a submit button The javascript calls the external web service. I am using a script manager to register the service reference.

Now this seems to work when I put the web service inside the project in which the server control is later registered in (Meaning in my website) and when inline script is set to true. Though it does not work when my web service is not in the same project as my website.

I am using aspnet and c# 3.5

I have no idea what might cause it to act this way. Any thoughts?

Best Answer

Not sure if this helps, but you have to make sure that the webservice is in the same domain as the page containing the scriptmanager (see this page for details).

Maybe if you can post some sample code, it will be easier to help.