2.0 Login Control

Topics: Controls, Themes
Nov 25, 2010 at 1:40 AM

Some feedback, for the benefit of others, on the new 2.0 upgrade and a question :-)

I have just upgraded from to 2.0 and have my old data being successfully pulled from SQL Server 2008. I followed the upgrade documentation here. I created a new blank DB and used the Database Publishing Wizard to migrate my old data and then ran the DB upgrade script. Finally, I updated the SQLServerWeb.Config file in the setup folder and replaced the existing Web.Config file with it.

The first thing I noticed is that the login link does not work correctly. I'm aware that the login form is in a new "Account" folder and when I manually changed the URL in the browser address bar I was able  to reach the login. How do I fix the login link to point to the new login form location? When I use the master page in my custom theme folder, it won't resolve. It works with the new Standard theme. I feel like I'm missing something?

New master page:

    <div class="login">
         <span runat="server" id="aUser"></span><a runat="server" id="aLogin" />

Old master page:

    <li><a runat="server" id="aLogin" /></li>

The next problem was that my login user name and password was not recognized. Why was this if the DB info was scripted over to the new DB? I solved this by using the WSAT tool in VS and creating another admin account, then deleting the old account which actually displayed in WSAT?

Nov 25, 2010 at 2:42 AM

In this case, the URL for that login hyperlink is set within site.master.cs (not site.master).  It'll probably be in the Page_Load event within site.master.cs.

I'm not sure why your username and password wasn't recognized.  It sounds like you are using a DB to store some data.  If you compare your old web.config to your new web.config, you might want to check what the defaultProvider is for <membership> and <roleManager>.  It looks something like this in the web.config file:

<membership defaultProvider="XmlMembershipProvider">
<roleManager defaultProvider="XmlRoleProvider" ...>
You would want to check to see what the "defaultProvider" is.  It's possible you were using the DbMembershipProvider before, and now the XmlMembershipProvider, or vice versa.  If using the DbMembershipProvider, the usernames & passwords are stored in be_Users.  If using the XmlMembershipProvider, the usernames & passwords are stored in users.xml in the App_Data folder.

But since you created a new account, you don't need to check this.  Just if you are trying to solve the mystery.

Nov 25, 2010 at 2:53 AM

Thanks Ben, that makes sense. I'm going to tweak the new master page instead as I also notice that it's using a new Security class in the code-behind. This is probably the safer route :-)