0

asp.net ajax webmethods(aspxページの静的メソッド)をインターセプトする方法はありますか?

リクエストがメソッドに到達する前と、レスポンスを送信した後にインターセプトしたい。

4

2 に答える 2

1

global.asax ファイルで使用

    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. domain.com/dfault.aspx/GetMessage;
if(ss=="http://domain.com/dfault.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. domain.com/dfault.aspx/GetMessage;;

if(ss=="http://domain.com/dfault.aspx/GetMessage")
{
do your work here
}
    }
于 2013-06-29T12:30:50.310 に答える
0

fiddlerまたはHTTtamperを試すことができます。

于 2013-06-29T12:16:37.520 に答える