Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Routing to Webservice

$
0
0

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


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>