开发者

Exception being handled in masterpage

If an exception开发者_开发技巧 was thrown in a page, would it be possible to be handled within the masterpage (assuming it wasn't handled before?)


If a method on the master page is one in the call chain above where the exception occurs, it can be caught in it.

What are you trying to accomplish? At a guess I would say that you need to explore the creation of a base page where you have your exception handling and inherit your other pages from it.


You could add handler to Page.Error event:

protected void Master_Init() 
{
    Page.Error += MyErrorHandler;
}

I am not sure, that there is Master_Init method in MasterPage class, but I believe, you got an idea.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜