hello to all
i want use ajax to web service and use routing i want use this url in ajax and redirect to webmwthod in webservice
for example services/api/helloword
and i rout to services/global.asmx/helloword
how i cant do it?
i use this code but not work
public static void RegisterRoutes(RouteCollection routes) { routes.MapPageRoute("","services/{action}", "~/Services/global.asmx"); } public class WebServiceRouteHandler : IRouteHandler { private string _VirtualPath; public WebServiceRouteHandler(string virtualPath) { _VirtualPath = virtualPath; } public IHttpHandler GetHttpHandler(RequestContext requestContext) { return new WebServiceHandlerFactory().GetHandler(HttpContext.Current, "*", _VirtualPath, HttpContext.Current.Server.MapPath(_VirtualPath)); } }
please help me