I am making a jquery call from a javascript method. I want a parameter to be sent to my call back method. I am using a handler(ashx) to make jquery call, the handler is getting invoked by the callback is not getting fired.
Below is the code
function MyButtonClick(){
var myDiv = "divname";
$.post("MyHandler.ashx", { tgt: 1 }, myDiv, CustomCallBack);
}
function CustomCallBack(data, result) {
debugger;
//SomeCode
}
}
Handler code(ashx file)
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
int tgt = Convert.ToInt32(context.Request["tgt"]);
if (tgt == 1)
{
context.Response.Write("Some text");
}
}