Mono Support Add custom fields in user profile 

Viewed 18125 time(s), 6 post(s), 8/8/2014 2:04:06 PM - by Rinkle
8/8/2014 2:04:06 PM
25 Reputation 3 Total posts

I am using the ASP.NET Profile infrastructure method to add customer fields in web.config as per http://www.mono-software.com/blog/post/Mono/38/Support-for-ASP-NET-profiles-in-MonoX/.But get following error :

The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?).

Give me solution for that.
 




 

1
8/11/2014 8:00:06 AM
15993 Reputation 2214 Total posts

Hi,

please find more information about this issue here:

Problem-adding-custom-profile

Regards

2
8/18/2014 10:37:47 AM
25 Reputation 3 Total posts

I've added custom field in web.config and created ProfileCommon class .
   namespace ProjectName.Web
{
    public class ProfileCommon : ProfileBase
    {
        public static System.String Phone
        {
            get { return HttpContext.Current.Profile.GetPropertyValue("Phone") as System.String; }
            set { HttpContext.Current.Profile.SetPropertyValue("Phone", value); }
        }
      }
}
Change in web.config :
<profile enabled="true" defaultProvider="AspNetSqlProfileProvider" >
      <providers>
        <remove name="AspNetSqlProfileProvider" />
        <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="MonoX" type="System.Web.Profile.SqlProfileProvider" />
      </providers>
      <properties>
         <add name="Phone" type="System.String" />
      </properties>
    </profile>

But i get the following error :
The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)

Please tell me where I'm wrong?


3
8/19/2014 2:37:11 PM
15993 Reputation 2214 Total posts

Can you please answer on these question

Are you using WAP project type ? - then ProfileCommon class isn’t available at all 
Are you using Web site project type ? - Be sure that you have added using statement inside the class that is using ProfileCommon if you are using ProfileCommon outside the App_Code 

Thanks

4
8/20/2014 4:19:47 AM
25 Reputation 3 Total posts

I am using WAP project.So i created  ProfileCommon class as above mentioned. 
But i get the " The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?) " error.
How can i add custom fields for user profile without programming ?

5
8/22/2014 3:03:36 PM
2793 Reputation 345 Total posts

btw, it would be nice if the user could select a preferred language in their profile

6
This is a demo site for MonoX. Please visit Mono Software for more info.