This project is read-only.

ASP.NET Membership: BE doesn't think I am admin

Topics: ASP.NET 2.0
Apr 20, 2009 at 1:33 AM
Hi, guys.

I somehow managed to integrate BlogEngine with existing ASP.NET site (without separate application in IIS). After a few hours of work everything builds up and I fixed all runtime errors.

I can't see links in Administration widget, nothing except "Change password". ASP.NET Membership is working, I can log in and change my password. It seem like BlogEngine thinks I'm not in Administrators role, but I am. Here is the proof:

From web.config:

  <roleManager enabled="true" defaultProvider="CustomizedRoleProvider">
        <add name="CustomizedRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="itinwebsite"/>

    <membership defaultProvider="AspNetSqlMembershipProvider">
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="1" applicationName="itinwebsite"/>

    <add key="BlogEngine.FileExtension" value=".aspx"/>
    <add key="BlogEngine.VirtualPath" value="~/blog/"/>
    <add key="BlogEngine.MobileDevices" value="(nokia|sonyericsson|blackberry|samsung|sec\-|windows ce|motorola|mot\-|up.b|midp\-)"/>
    <add key="BlogEngine.AdminRole" value="Administrators"/>
    <add key="StorageLocation" value="~/App_Data/"/>
    <add key="BlogEngine.HardMinify" value="blog.js,widget.js,WebResource.axd"/>

Am I doing something wrong?

Best regards,
Apr 20, 2009 at 5:23 AM
Offhand, I'm not sure the problem.  But was just curious if you can access one of the control panel pages directly ... or if you get kicked out to the login.aspx page.  For example:

Apr 20, 2009 at 8:09 AM
Hello, Ben.

Yes, I can access the page, no problem:

Free Image Hosting at

I can't even find a place in the code where Administration widget checks if it should display the links or not :( Any suggestions where I should start digging?

Best regards,
Apr 20, 2009 at 8:10 AM
PS. I have changed theme. No luck, same problem.
Apr 20, 2009 at 6:57 PM
That's good news that you can access the Settings page and other pages too, I presume.  Access to those pages is controlled by the Web.config file in the admin\Pages folder.  Only administrators can access some of those pages like Settings.  So the fact that you can access them is a good sign.

The menu is defined in the Web.sitemap file in the root of the blog.  The code that outputs the menu links is in the menu.ascx.cs file in the admin folder.  So if you put a breakpoint in there and follow the code as it's executing, that should hopefully shed some light on the situation.
Apr 21, 2009 at 1:15 AM
Oh, yeah!

With your help it took me less than 2 minutes to find the problem. Turned out it had nothing to do with membersip provider. I just had to change path to the sitemap in web.config:

<add name="SecuritySiteMap" description="Used for authenticated users." type="System.Web.XmlSiteMapProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" securityTrimmingEnabled="true" siteMapFile="~/blog/Web.sitemap"/>

Thank you so much!
Jul 20, 2010 at 7:13 PM
sergeykovalev can you please post the steps to integrate the blog in existing website using membership control? Thank you!