I have an asp.net mvc application and i need to to use ajax in this application , i need to add a scriptmanager and add a service refrences with the path of a web service and then call the web service from tag . I have the following code and it doesn't see the web service :
<form>
<input id="SubmitBtn" type="button" value="Sumbit" onclick="TestService(); return false;" />
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/MVCService.asmx" />
</Services>
</asp:ScriptManager>
<script type="text/javascript" language="javascript">
function TestService()
{
alert('Welcome');
var ret = MVCService.HelloWorld(OnCheckComplete,OnFailed,OnTimeOut);
}
function OnCheckComplete(arg)
{
alert(arg);
}
function OnFailed(arg)
{
alert(arg);
}
function OnTimeOut(arg)
{
alert(arg);
}
</script>
</form>
And it reports an error say : MVCService is undefined so how can i solve this problem ? do i need specific configuration in the MVC application to solve this problem ? I have add ajax toolkit dll to my application refrences and the problem still exist
Thanks in advance