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 new profile fields?  (Mono Support )

60857 put(a) pogledan, 13 odgovor(a) 26.9.2010. 20:31:26Kreirao(la) arielf
arielf

arielf

15.2.2011. 12:19:28
Hey there! I have started building a project with the monox platform and am quite impressed with the product. You've done a great job!
I have stumbled upon the issue of creating new profile fields. I have seen monox is built on top of asp.net membership, however, standard user profile customization (via web.config) is not allowed apparently. In the default web.config file the profile section is commented out:

<!-- Does not work with Ajax toolkit
    <profile enabled="true">
        <providers>
          <remove name="AspNetSqlProfileProvider"/>
          <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="MonoX" type="System.Web.Profile.SqlProfileProvider" />
        </providers>
        <properties>
        <add name="Location" allowAnonymous="true" defaultValue="50,300"/>
      </properties>
    </profile>
    -->


Do I add custom columns to the UserProfile table in the DB instead?

Thanks!
Ovaj sadržaj još nije ocijenjen. 
0 Reputacija 11 Ukupno objava
khorvat

khorvat

28.9.2010. 10:21:51
Hi arielf,

as documented an early version of ajax toolkit had some issues with asp.net profile so we commented out that section. Since then we have upgraded the ajax toolkit and made some tests and it seems to work (it is not interfering with ajax toolkit) correctly. The bottom line is that we didn't fully test the profile in combination with new version of ajax toolkit so that's why we didn't uncomment the section.

Can you please try to uncomment the section and run the application.

If any of the problems appear please contact us and we will try to solve the issue.


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

kpeulic

28.9.2010. 10:37:20
Hi khorvat,

I have uncommented the section and it is working fine.

Regards
Ovaj sadržaj još nije ocijenjen. 
1849 Reputacija 181 Ukupno objava
arielf

arielf

28.9.2010. 13:39:24
Thanks a lot for your quick reply khorvat and kpeulic!

I have added a new profile field in the section of the web.config. However, I am not sure how to activate that field in the user profile control when a user edits his/her own profile. I am looking at both UserProfileModule.ascx and EditProfile.ascx but cannot figure out how to map HTML input fields with the new profile property.
Any suggestions? I assume the ORM is not involved here as this is native ASP.NET functionality.

Thanks a lot!
Ariel
Ovaj sadržaj još nije ocijenjen. 
0 Reputacija 11 Ukupno objava
khorvat

khorvat

28.9.2010. 14:43:01
One more thing related to this issue:

Asp.Net compiles the profile to the App_Code.dll which can't be shiped with the MonoX CMS because custom projects needs to have ability of having custom code put in to the Asp.net folder App_Code (which is compile it to the App_Code.dll).

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

arielf

28.9.2010. 14:59:08
Thanks for the details! I still cannot figure out how to add a custom field to the user profile. After adding it to the profile section of the we.config, do I need to recompile the whole project? How do I map the new profile field to input fields in the user profile page?

Ovaj sadržaj još nije ocijenjen. 
0 Reputacija 11 Ukupno objava
denis

denis

28.9.2010. 15:48:24
Hi Ariel,
Profile provider infrastructure went through a series of issues with different types of projects in VS 2005 and 2008. As MonoX v2 was started as a Web Site Project, we initially included a full support for profile providers in it. However, later changes and issues with Web Application Projects (WAP) forced us to abandon this approach. As Kristijan said, there is a little control of where the profile proxy class goes, and it makes deployment of projects rather cumbersome. In addition, there is no support for strongly typed profiles in WAP, which in our opinion almost beats the purpose of using this approach from a developer's point of view.
There are [url=http://murrayon.net/2009/02/aspnet-profile-and-web-application.html]some workarounds[/url], and this is still a convinient way to manipulate profiles for the end users and non-developers, so we are currently working on reintroducing the full profile provider support. In this version you will have to manually change the profile parts to achieve the desired effect. We are using the dedicated DB table for all additional user profile fields at the moment, which is related 1:1 to the aspnet_users table.
Ovaj sadržaj još nije ocijenjen. 
7207 Reputacija 956 Ukupno objava
khorvat

khorvat

28.9.2010. 15:55:01
Ariel,

one other thing to mention is that our best practice is to put all your custom user specific data to separate table and connect it 1:1 with UserProfile or aspnet_Users table. This is a better approach on the long run.

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

mat2

28.9.2010. 15:58:28
I am using the approach you just described - it looks more difficult at the beginning, but you get a full control over the data stored in the user's profile, which is something you will use with the default implementation of the profile provider.
Maybe it could be a different story with a custom provider?
Ovaj sadržaj još nije ocijenjen. 
0 Reputacija 6 Ukupno objava
arielf

arielf

28.9.2010. 18:22:50
Thanks for the support! I understand then that ASP.NET profile is not a good approach for the moment. Khorvat, the best practice you mention is clear in terms of the design. But how would implement that in practice? I can create a new table with custom data and set a 1:1 relationship to the UserProfile table, but still where do I add the business logic for those additional fields ? I would need to somehow blend that in within monox standard user profile page...

SOrry if I sound to noob with that, but I am just trying to measure the efforts involved in customizing monox!

Thank you again.

Ovaj sadržaj još nije ocijenjen. 
0 Reputacija 11 Ukupno objava
1 2