Correct use of System.Web.HttpResponse.Redirect

Try very, very hard to avoid using Response.Redirect(url), instead, use Response.Redirect(url, false).  Response.Redirect(url), after writing a 302 redirect response to the response buffers, calls Response.End.  This is very expensive.  The alternative, Response.Redirect(url, false) is fast, but unlike Response.Redirect(url), the lines of code which follow the call to Response.Redirect(url, false) will be executed.  More on this later, but…

11

Obtaining more information from an HttpException

ASP.NET throws HttpException for numerous types of errors, making it difficult to determine exactly what went wrong programmatically. You can parse the error message, but the message can be localized, and therefore parsing it can be non-trivial.  There is, however, a way that you can identify a few specific types of errors. In v2.0 there is an internal property on…

1