Skip Standard Error Screen Asp.Net
<p>I have an Application that you need to register in the db to connect to it but if you are not, there is a Error Screen but its really looking ugly as you can see </p>

<p><img src="http://i.stack.imgur.com/nsq08.gif" alt="enter image description here"></p>

<p>I have tried to check if the session where the user ID is saved == null and than clear Content and this is on the start page where every user is connecting first </p>

<pre><code>if (this.Session["SessionId"] ==null)
{
    Response.ClearContent();
    Response.Write("ERROR");
    Response.End();
}
</code></pre>

<p>Why do I get here an error </p>

<pre><code>  &lt;system.web&gt;
    &lt;customErrors defaultRedirect="~/Error/Error.aspx" mode="Off"/&gt;

  &lt;/system.web&gt;
</code></pre>

<p>Thanks for help and fast answer </p>
