在这种情形下,我也希望绕过我正常的错误记录,这种记录赢得了工作,只是要求埃尔傲慢的观点,发出电子邮件。 我不想重复所有控制人员处理这一特殊案件的做法,在要求采取任何行动之前,可能会试图让非行进入。 我应该把这名特别手提放在哪里,如果不是控制人,那么我如何看待错误观点?
Oh 是的,Im利用Elmah例行记录未经处理的例外情况。
在这种情形下,我也希望绕过我正常的错误记录,这种记录赢得了工作,只是要求埃尔傲慢的观点,发出电子邮件。 我不想重复所有控制人员处理这一特殊案件的做法,在要求采取任何行动之前,可能会试图让非行进入。 我应该把这名特别手提放在哪里,如果不是控制人,那么我如何看待错误观点?
Oh 是的,Im利用Elmah例行记录未经处理的例外情况。
贵方控制员使用这些内容
[HandleError(ExceptionType = typeof(SqlException), View = "SqlError")]
Public Class ProductController: Controller {
public ViewResult Item(string itemID)
{
Item item = ItemRepository.GetItem(itemID);
return View(item);
}
}
现在,在您的<编码>意见/共享/中,你可以形成一种称为“SqlError.aspx”的观点,如果存在一种特殊的例外情况,该观点将予退回。
我也建议处理你在全球提出的所有申请。 页: 1 IE: The part that do the emailing of the有误、记录错误等。
Check out this SO question for an idea
ASP.NET MVC Custom Error Handling Application_Error Global.asax?
我不知道你的代码是什么,但假设在某些全球错误处理事项中进行伐木,那么处理错误就象这样做一样:
try
{
//logging
}
catch(SqlException)
{
//send email
return View("Error");
}
In my webpages I have references to js and images as such: "../../Content/Images/"Filename" In my code if I reference a file as above, it doesnt work so i have to write: "c:/miscfiles/"filename" 1-...
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
I m looking for best practices here. Sorry. I know it s subjective, but there are a lot of smart people here, so there ought to be some "very good" ways of doing this. I have a custom object called ...
I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...
i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...
For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?
I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!