Is there a way to intercept asp.net ajax webmethods(aspx page static methods)?
i want to intercept before request reaching the method and also after sending the response.
Is there a way to intercept asp.net ajax webmethods(aspx page static methods)?
i want to intercept before request reaching the method and also after sending the response.
use in global.asax file
protected void Application_BeginRequest(Object sender, EventArgs e)
{
//before method colling
string ss = HttpContext.Current.Request.Url.ToString();//use if it is equal to your page webmethod url i.e. example.com/default.aspx/GetMessage;
if(ss == "http://example.com/default.aspx/GetMessage")
{
// do your work here
}
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
//after method colling
string ss = HttpContext.Current.Request.Url.ToString();// use if it is equal to your page webmethod i.e. example.com/default.aspx/GetMessage;
if(ss=="http://example.com/default.aspx/GetMessage")
{
// do your work here
}
}