views:

960

answers:

1

Hi all,

I am porting a site I had developed on an old box across to a new dev env. I have not just copied all the files as I didn't have a great file structure and some parts of the code needed to be removed as I went along.

Originally I had created a website (File -> New -> Web Site). I wanted a file structure something like:

http://stackoverflow.com/questions/446017/popular-folder-structure-for-build

So I created a new blank solution so the sln file was on its own, then added projects (various DLL projects) and am ASP.NET Web Application.

This last part seems to have caused me a few issues, I am now getting the following error:

"The type or namespace name ' ProfileCommon' could not be found".

I found the following page:

http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx

It seems a bit long winded and I was hoping someone might know of a better solution.

I am trying to use the ProfileCommon with the CreateUser Wizard as I add a little extra information into it.

protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
    // Create an empty Profile for the newly created user
    ProfileCommon p = (ProfileCommon)ProfileCommon.Create(CreateUserWizard1.UserName, true);

    // Populate some Profile properties off of the create user wizard
    p.CurrentLevel = Int32.Parse(((DropDownList)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("clevel")).SelectedValue);

    // Save profile - must be done since we explicitly created it
    p.Save();
}

Web.config:

<profile enabled="true">
<properties>
 <add name="CurrentLevel" type="Int32"/>
</properties>
</profile>

If there is another way to add this extra information into the creation wizard, or just a better way of setting extra info to a new user then I am all ears and would be very grateful.

Thanks for the help and advice.

+1  A: 

I found "a" solution to this one. Not sure if it is the best one or not but it worked for my situation. Minimal code changes required.

http://msdn.microsoft.com/en-us/library/aa983476.aspx

Hope it might help someone else, (or me when I forget it again).

Jon