Yellow Screen Of Death (YSOD)
When an unhandled exception arises in an ASP.NET application one of three types of error pages is displayed: By default, ASP.NET displays an error page that is affectionately referred to as the Yellow Screen of Death (YSOD). YSOD showed some Sensitive information that can be used by attackers . Show its good practice to show custom error info in front of your users.
Setting in Webconfg file
<system.web>
<compilation debug="true" targetFramework="4.7.2" />
<httpRuntime targetFramework="4.7.2" />
<trust level="Full" />
<customErrors mode="RemoteOnly"
defaultRedirect="~/Shared/Error.cshtml" />
</system.web>
Show error in custom error file
@model System.Web.Mvc.HandleErrorInfo
<div class="container">
<h1>Error.</h1>
<h2>An
error occurred while processing your request.</h2>
<h3 style="color:red"><p style="color:red"> @Model.Exception.Message</p></h3>
<br /><br />
</div>
No comments:
Post a Comment