MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Add custom fields in user profile  (Mono Support )

Viewed 17036 time(s), 6 post(s) 8/8/2014 2:04:06 PMby Rinkle
Rinkle

Rinkle

8/8/2014 2:04:06 PM
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.
 




 
This content has not been rated yet. 
25 Reputation 3 Total posts
khorvat

khorvat

8/11/2014 8:00:06 AM
Hi,

please find more information about this issue here:

Problem-adding-custom-profile

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
Rinkle

Rinkle

8/18/2014 10:37:47 AM
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?


This content has not been rated yet. 
25 Reputation 3 Total posts
khorvat

khorvat

8/19/2014 2:37:11 PM
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
This content has not been rated yet. 
15993 Reputation 2214 Total posts
Rinkle

Rinkle

8/20/2014 4:19:47 AM
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 ?
This content has not been rated yet. 
25 Reputation 3 Total posts
Zoomicon

Zoomicon

8/22/2014 3:03:36 PM
btw, it would be nice if the user could select a preferred language in their profile
This content has not been rated yet. 
2793 Reputation 345 Total posts