如何在mvc3中抛出sql异常进行查看 [英] How to throw sql exceptions to view in mvc3

查看:101
本文介绍了如何在mvc3中抛出sql异常进行查看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在mvc3中抛出sql异常

解决方案

看看这里:实现错误处理 [ ^ ]。



引用:

HandleErrorAttribute [ ^ ]属性允许您指定如何处理操作方法引发的异常。默认情况下,当具有HandleErrorAttribute属性的操作方法抛出任何异常时,MVC将显示位于〜/ Views / Shared文件夹中的Error视图。


How to throw sql exceptions to view in mvc3

解决方案

Have a look here: Implementing an Error-Handling[^].

Quote:

The HandleErrorAttribute[^] attribute in ASP.NET MVC lets you specify how to handle an exception that is thrown by an action method. By default, when an action method with the HandleErrorAttribute attribute throws any exception, MVC displays the Error view that is located in the ~/Views/Shared folder.


这篇关于如何在mvc3中抛出sql异常进行查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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