Saturday 12 July 2014

Custom Error Asp.Net

Create or modify the section of the web.config file to
have the below settings:
You can then add an error.html file to your application that contains an appropriate error page of your choosing (containing whatever content you like). This file will be displayed anytime an error occurs within the web application.
.Net 4.0

Replace your Error.aspx file code with below code

System.Threading
System.Security.Cryptography
void Page_Load() {
byte[] delay = new byte[1];
RandomNumberGenerator prng = new RNGCryptoServiceProvider();
prng.GetBytes(delay);
Thread.Sleep((int)delay[0]);
IDisposable disposable = prng as IDisposable;
if (disposable != null) { disposable.Dispose(); }
}