NameService not defined error
I'm trying the web service TryItOut and cannot get a reference to the NameService I've created. I cannot have it recognized by Intellisence and when I run the application I only receive a message that says ["NameService" is not defined].
This is the code on the WebServices web form:
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
<Services>
<asp:ServiceReference Path="~/WebServices/NameService.asmx" />
</Services>
</asp:ScriptManagerProxy>
<input id="YourName" type="text" />
<input id="SayHello" type="button" value="SayHello" />
<script type="text/javascript">
function HelloWorld()
{
var yourName = $get('YourName').value;
NameService.HelloWorld(yourName, HelloWorldCallback);
}
function HelloWorldCallback(result)
{
alert(result);
}
$addHandler($get('SayHello'), 'click', HelloWorld);
</script>
</asp:Content>
and, off course, the NamesService.asmx is located in the WebServices folder.
Any clue?
Regards, Antonio Plais, from Brazil
|