Error when trying to login for the first time

Topics: ASP.NET 2.0
Jul 28, 2010 at 6:27 AM

Ooops! An unexpected error has occurred. is what I recieve with no clue of anything thats wrong.  I dont fancy the users giving me lashes!

Jul 28, 2010 at 8:23 AM

Normally, if an unexpected error occurs like this, it will show you error details -- but you would first need to be logged in to see those error details.  In this case, you're obviously trying to login.  In the root folder of BE, there's a file named error.aspx.cs.  In there, you'll see this line of code:

if (Page.User.Identity.IsAuthenticated && HttpContext.Current.Items.Contains(contextItemKey))

... change that temporarily to:

if (true && HttpContext.Current.Items.Contains(contextItemKey))
And then try logging in again.  You'll hopefully get some additional error details to try and understand what the problem is.

Jul 28, 2010 at 2:29 PM

Thank you for that.  The error seems to be when I setup the blog as a virtual directory off of my main site.  However I have now setup the blog on a sub domain and it all seems to work well.  Is there a drawback to setting it up that way?