追赶中的.aspx和的.ascx页面异常 [英] Catching exceptions within .aspx and .ascx pages

查看:90
本文介绍了追赶中的.aspx和的.ascx页面异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的问题说的一切,拿这个例子code:

The questions says everything, take this example code:

<ul id="css-id">
    <li>
    <something:CustomControl ID="SomeThingElse" runat="server" />
    <something:OtherCustomControl runat="server" />
    </li>
</ul>

现在,如果错误被这些controlls(位于一个母版页),他们会采取了整个网站内的某处抛出,如何将一个捕获这些异常?

Now if an error gets thrown somewhere inside these controlls (that are located in a master page) they will take down the entire site, how would one catch these exceptions?

推荐答案

您可以赶上无法在Global.asax页/类处理elswhere所有的异常。 请看:

You can catch all exception not handled elswhere in the Global.asax page / class. Look at:

protected void Application_Error(Object sender, EventArgs e)

方法。

这篇关于追赶中的.aspx和的.ascx页面异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆