I have a WCF service in folder "Services":
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web.Services;
using System.ServiceModel.Activation;
using System.Web.Script.Services;
namespace Application.Services
{
[ServiceContract]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ScriptService]
public class ProductTypeService
{
[OperationContract]
[WebMethod]
public string LoadMainGridProductType(string test)
{
return "Success";
}
}
}
and on page I try to call this service method from javascript:
$(document).ready(function () {
var counter = "test";
Application.Services.ProductTypeService.LoadMainGridProductType(counter, ResultLoadMainGridProductType, ErrorLoadMainGridProductType);
});
on page I also make conect to this service and javascript files:
<asp:ScriptManager ID="ScriptManager" runat="server">
<Scripts>
<asp:ScriptReference Path="~/Scripts/ProductType.js" />
</Scripts>
<Services>
<asp:ServiceReference Path="~/Services/ProductTypeService.svc" />
</Services>
</asp:ScriptManager>
but code fails on
Application.Services.ProductTypeService.LoadMainGridProductType(counter, ResultLoadMainGridProductType, ErrorLoadMainGridProductType);
Error : Error of implementation of Microsoft Jscript: "Application" is not certain. How fix this???