I have an application that you need to register in db to connect to it, but if you haven’t done this, there is an error screen, but it really looks ugly, as you can see

I tried to check if the session in which the user id, == null and clear content was saved was saved, and this is on the start page where every user connects first
if (this.Session["SessionId"] ==null) { Response.ClearContent(); Response.Write("ERROR"); Response.End(); }
Why am I getting an error here
<system.web> <customErrors defaultRedirect="~/Error/Error.aspx" mode="Off"/> </system.web>
Thanks for the help and quick reply.
user1767695
source share