I have created a http handler fro my Jquery ajax call. which is working fine the jquery call is mentioned below
$.ajax({
url: "Services/name.ashx",
contentType: "text/plain",
data: {
CustMobile: a,
CustName: b,
CustEmail: c
},
contentType: "application/json; charset=utf-8",
success: function (data) {
$("#loading").hide();
},
error: function () {
$("#loading").hide();
}
});
Now my problem is this can I call the name.ashx handler through my code behind. I am using asp.net with C#. I know that it can be called by Response.write(“”) writing the whole script part. Ans also Register Script of page method.
But Is there any way by which I can send request to handler and get back response from the handler using c#.
Thanks.
You can call any http resource from code behind using
HttpWebRequest(System.Net namespace)Sample
You need an absolute path but you can get your domain or server url from the HttpContext if you dont want to hardcode the domain
More Information