Can't login locally,

Mar 22, 2011 at 10:03 PM

The website works fine online but in trying to test a new theme locally I cannot login, receive this error.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /BE_2.0_SAHC_2011/Account/Login

This is the site.master.cs

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;

public partial class site : System.Web.UI.MasterPage
protected void Page_Load(object sender, EventArgs e)
if (Page.User.Identity.IsAuthenticated)
aLogin.InnerText = Resources.labels.logoff;
aLogin.HRef = BlogEngine.Core.Utils.RelativeWebRoot + "Account/Login.aspx?logoff";
aLogin.HRef = BlogEngine.Core.Utils.RelativeWebRoot + "Account/Login.aspx";
aLogin.InnerText = Resources.labels.login;
string bgImage;

if (DateTime.Now.Second < 10)
bgImage = "portrait-1.jpg";
else if (DateTime.Now.Second < 20)
bgImage = "portrait-2.jpg";
else if (DateTime.Now.Second < 30)
bgImage = "portrait-3.jpg";
else if (DateTime.Now.Second < 40)
bgImage = "portrait-4.jpg";
else if (DateTime.Now.Second < 50)
bgImage = "portrait-5.jpg";
bgImage = "portrait.jpg";

litPortrait.Text = string.Format(
"<div id=\"portrait\" " +
"style=\"background-image:" +
BlogEngine.Core.Utils.RelativeWebRoot, bgImage);

protected void Page_PreRender(object sender, EventArgs e)
if (phSidebar.Visible)
Form1.Attributes.Add("class", "body");
Form1.Attributes.Add("class", "body noSidebar");

public string MenuClass(string menuName)
if (Request.RawUrl.Contains(menuName))
return "class=\"menu-hover\"";
return string.Empty;






Mar 23, 2011 at 7:18 AM

The "requested URL" in the error message says:  /BE_2.0_SAHC_2011/Account/Login

It doesn't have the .ASPX at the end.  It looks like the "login" page is being requested.  So my guess is that when you receive this error, if you look at the address bar of your browser, you'll see it ends in /account/login without the .ASPX.

I'm not sure where you are coming from prior to getting this error message, but if this error message has only started to appear with a new theme, then I would check all of the theme files to see if there is a "login" without the ".aspx" at the end.

Mar 23, 2011 at 12:39 PM
Edited Mar 23, 2011 at 4:12 PM

Hi Ben,

I am viewing the default.aspx in browsers locally trying to login and get to admin settings so I can view different themes and maybe chose a new theme.  I know I can do this online but I am trying to tweak a theme css file and view it, it would be difficult and time consuming to make a change and publish each time.

When I run default.aspx locally and put my cursor on Login in the top menu the url shows http://localhost:43400/BE_2.0_SAHC_2011/Account/Login.aspx, however when I click on it this is the result, The "requested URL" in the error message says: /BE_2.0_SAHC_2011/Account/Login, the aspx is missing.

There used to be an option in the web.config to change the theme but it is not there anymore.

I am trying to figure out why I cannot get to  login.aspx locally from the default page.  Even if I try to run login.aspx locally the same error comes up.

Mar 24, 2011 at 11:35 AM

I'm not sure entirely.  What if you manually append the .aspx to the URL in the address bar?  Does that work, or does it end up redirecting you back to /Login without the .aspx?  Did it work locally before?

Mar 24, 2011 at 1:47 PM

When I manually append .aspx it still reverts back to /login with the .aspx.  I used to work fine locally.

Mar 24, 2011 at 4:47 PM

I forgot to mention that this occurs in VWD Express as well as WebMatrix.

Mar 28, 2011 at 10:34 AM

This is still an unresolved issue.  Thanks

Mar 29, 2011 at 7:40 PM

> The website works fine online but in trying to test a new theme locally I cannot login, receive this error.

>  /BE_2.0_SAHC_2011/Account/Login

Maybe an invalid URL with dot 2.0 ?

Mar 29, 2011 at 9:04 PM

This is the URL 

aLogin.HRef = BlogEngine.Core.Utils.RelativeWebRoot + "Account/Login.aspx";
aLogin.InnerText = Resources.labels.login;


Name of website = BE_2.0_SAHC_2011

Mar 30, 2011 at 11:47 AM

Did you say this problem only happens with one of the themes?  Or all themes?

If you cannot log in to change the theme, you can manually update the theme in the be_Settings DB table .. and then restart the blog for the theme you change to to become effective.  The point of this is in case you are unsure if this is a problem with just one theme, or all themes, this would allow you to change themes (by manually making the change in the DB) to see if the problem is theme specific.

Mar 30, 2011 at 1:16 PM

I have found some of the themes have mistakes with the login link. Professional Light had to be fixed in the masterpage for me. But it wasn't dropping the extension. If you view the source does the extension show up?

Mar 30, 2011 at 1:30 PM
Edited Mar 30, 2011 at 1:53 PM

I will check this out,. I also downloaded the latest code and set it up, the theme I am having trouble with works ok with this release.



I made the change above in the be_Settings DB table  and now receive this error:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: The type initializer for 'BlogEngine.Core.BlogSettings' threw an exception.

Source Error: 

Line 113:      <providers>
Line 114:        <clear />
Line 115:        <add name="XmlMembershipProvider" type="BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core" description="XML membership provider" passwordFormat="Clear" />
Line 116:        <add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="BlogEngine" applicationName="BlogEngine" />
Line 117:        <add name="DbMembershipProvider" type="BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core" passwordFormat="Clear" connectionStringName="BlogEngine" />

Source File: C:\Users\Jerry Dean\Documents\Visual Studio 2010\Websites_2011\BE_2.0_SAHC_2011\web.config    Line: 115 

Mar 30, 2011 at 2:09 PM

One thing that changed in 2.0 was membership related files moved to "account" folder.

When updating, you need to make sure that "login.aspx" replaced with "account/login.aspx" in web.config and your custom theme if it used there.

Mar 30, 2011 at 2:14 PM

New information:

I tried using the web.config from the latest code setup that works as described above, changed the theme setting as requested above and the same redirection error occurs so this issue is something else and not theme specific.

Mar 30, 2011 at 2:22 PM

Now neither application works, I went back to the new BE installation and now receive this error even after trying to change to another theme in the settings DB.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS1513: } expected

Source Error:

Line 40:           BlogEngine.Core.Utils.RelativeWebRoot, bgImage);
Line 41: 
Line 42:   }
Line 43:   protected void Page_PreRender(object sender, EventArgs e)
Line 44:   {

Source File: c:\Users\Jerry Dean\Documents\Visual Studio 2010\Websites_2011\BlogEngine.NET\themes\Portraitpress\site.master.cs    Line: 42 

Mar 30, 2011 at 2:31 PM
Edited Mar 30, 2011 at 2:35 PM

This issue is resolved, I found a missing bracket in the theme site.master.cs file, funny it was working on the server but not locally.

Thanks for you help.



Checked the cs on the server and of course the bracket was there.