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 )

18558 put(a) pogledan, 6 odgovor(a) 8.8.2014. 14:04:06Kreirao(la) Rinkle
Rinkle

Rinkle

8.8.2014. 14:04:06
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.
 




 
Ovaj sadržaj još nije ocijenjen. 
25 Reputacija 3 Ukupno objava
khorvat

khorvat

11.8.2014. 8:00:06
Hi,

please find more information about this issue here:

Problem-adding-custom-profile

Regards
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
Rinkle

Rinkle

18.8.2014. 10:37:47
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?


Ovaj sadržaj još nije ocijenjen. 
25 Reputacija 3 Ukupno objava
khorvat

khorvat

19.8.2014. 14:37:11
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
Rinkle

Rinkle

20.8.2014. 4:19:47
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 ?
Ovaj sadržaj još nije ocijenjen. 
25 Reputacija 3 Ukupno objava
Zoomicon

Zoomicon

22.8.2014. 15:03:36
btw, it would be nice if the user could select a preferred language in their profile
Ovaj sadržaj još nije ocijenjen. 
2793 Reputacija 345 Ukupno objava