开发者

Simulating RemoteOnly custom errors using Application_Error ASP.NET

I handle my errors using Application_Error in global.asax.

How to check if the request is from the local client to display more information about the error or just show the yellow error page. Something like "remoteOnly" that ASP d开发者_JAVA百科oes when handling errors using web.config.


After I posted the question, I went back to my application and played around a little bit then I found this. Now I'm using it.

    void Application_Error(object sender, EventArgs e)
    {

        if(!HttpContext.Current.Request.IsLocal) 
            HttpContext.Current.Server.ClearError();

        // process error handling
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜