Hello,
I am running into an issue trying to set up my web service and calling it via my javascript. My webservice is defined like:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[ScriptService]
public class NameService : System.Web.Services.WebService {
[WebMethod]
public string HelloWorld(string yourName) { return string.Format("Hello {0}", yourName); } }
In my ASPX page I am using a ScriptManagerProxy like:
<asp:ScriptManagerProxy runat="server" ID="scriptManagerProxy1">
<Services>
<asp:ServiceReference Path="~/WebServices/NameService.asmx" />
</Services>
</asp:ScriptManagerProxy>
Then my javascript looks like:
function Test(name) {
NameService.HelloWorld(name, MyCallback);
}
The problem is that I am getting an error that NameService is undefined. I am not sure what I am missing. According to everything I can find, it should be known in the client but I am new to ASP.NET AJAX so who knows?
Any thoughts? - Peter