grouping profile properties

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
4/19/2011 3:33:40 AM
Gravatar
Total Posts 92
Нет, я не изменил. До старости глубокой...

grouping profile properties

Dears,

please advice if there is a way to group the profile properties because I have a client whose profile is very big, more than 100 fields / 4 sections to fill, but they are in sections or groups, for example:

1. General Information

2. Education and Experience

3. resume details

..etc

And I would view it in a separated Tabs, should I make new registration control(s) or can I somehow using mojoProfile.config to pass this group/section name?

I just do not want to make ALL these fields in a separate controls and tables while I can use userconfig ! :(

Any help will be appreciated

 

Regards

4/20/2011 8:08:56 AM
Gravatar
Total Posts 18439

Re: grouping profile properties

Hi ghalib,

My advice is don't try to do all of that with the custom profile system.

What I would do is implement one custom usercontrol.ascx that implements ISettingControl, the implementation would just be a fake it could have a hard coded value in the get method and the set method doesn't have to do anything, but by implementing this you can add the usercontrol to the profile.

Then in the usercontrol you should link to a custom page(s) where you implement your own functionality for all this information such as resume etc and you can then group it however you like.

The custom profile system makes it easy for simple profile properties but it is not really suited for all possible needs, when you have more elaborate needs you should implement something custom where you can have more control to do whatever you need.

Hope it helps,

Joe

4/20/2011 11:19:06 PM
Gravatar
Total Posts 92
Нет, я не изменил. До старости глубокой...

Re: grouping profile properties

Thank You Joe, you are the best :)

5/16/2011 12:02:35 PM
Gravatar
Total Posts 92
Нет, я не изменил. До старости глубокой...

Re: grouping profile properties

Hi Joe,

I need your help again please.

I made my "customProfileSetting.ascx" implementing ISettingControl and inside I pointed to customProfileTabs.ascx which holds inside all my Tabs and their fields.

In the MyUserprofile.config i used the next link:

<add name="customProfile"
          type=""
          iSettingControlSrc="~/Secure/AlJidaraProfile/customProfileSetting.ascx"
          resourceFile="AlJidaraProfileResource"
          labelResourceKey="customProfileLabel"
          defaultValue=""
          requiredForRegistration="true"
          regexValidationExpression=""
          regexValidationErrorResourceKey=""
          includeHelpLink="false"
   />

 

And all works fine and smooth, but there still one problem, When user register the Register.aspx is working fine and registering the user, but how to save the fields inside my control? If the page is valid the page Register.aspx will not go back to my control event page_load where I can put a trigger to save the fields!

I do not know if i explained enough and correct but I need to save my EXTRA user profile fields after initial user registration. As I debug your code, first you create user using mojoMemebrShipProvider then you update the user properties in the mojoProfile.config and what I need is to contiue updating the user details in my control which I do not know how!!!

One solution is the worst one and I would not like to implement is to override page Register.aspx...! :(

 

Any help or suggestions will be appreciated..

 

5/17/2011 2:09:43 AM
Gravatar
Total Posts 92
Нет, я не изменил. До старости глубокой...

Re: grouping profile properties

Hi Joe,

any tips? or suggestion? thank you 

5/17/2011 6:19:06 AM
Gravatar
Total Posts 18439

Re: grouping profile properties

Hi Ghalib,

You can use an update panel inside your control and you can add your own button to save "Education Info" or whatever your additional information is. That should work on the profile page.

For fields required at registration it is a trickier problem if the user is not yet created it would not be possible to save your data with the userid or userguid until the user is created.

It might be best to stick with the built in profile system for fields required at registration. I don't have any perfect solution but I can suggest some ideas.

You can use the validationgroup "profile" on your custom required field validators, that will at least require the user to enter your custom data.

While you can't really participate in the button click event for the outer page, your page load event will fire and if(Page.IsPostBack) you could look for your fields in the the request parameters or check your control values and maybe have an opportunity to save if you can obtain the SiteUser object.

You could implement a UserRegisteredEventHandler which will fire after the user is registered. You could try to access your control from there maybe by .FindControl and then call a method on it to save the data. If that doesn't work you should be able to at least get access to the raw posted form variables via the Request object.

Alternatively you might consider not having a lot of fields required to enter right on the registration page since it would be easier after the user is created. You could implement a custom HttpModule and plug it in via Web.config and in this module you could check the status of authenticated users and if the required data is not there force a redirect to the profile page so they can't go anywhere else until the data is completed. Since the user is already created it will be easier to work with your own button inside your ISettingControl. Notice how the Newsletter preferences in the profile page is like this, it has its own button and uses an updatepanel.

Hope these ideas help,

Joe

5/17/2011 7:07:35 AM
Gravatar
Total Posts 92
Нет, я не изменил. До старости глубокой...

Re: grouping profile properties

Thank you Joe, really helped me, I think I will do it, thanks , I own you one :)

7/3/2011 5:18:43 AM
Gravatar
Total Posts 92
Нет, я не изменил. До старости глубокой...

Re: grouping profile properties

Ok Joe,

I implemented last idea of yours, I removed all required fields, created handler to follow the user status. I am using a web user control for my fields, where I put all my tabs, also put "private void DoTabSelection " for them, but these tabs are not working, when I click any of them all of them are open in the same page, could that be because i am using user control and not a page where i cannot call SuppressAllMenus() or SuppressMenuSelection() in the page init?

I checked all your sources, you are using parameter "t" and you request it, but i could not find where you send it!

Now if I can not fix the tabs issue i need to override userProfile page..!

still need your help, sorry and thank you.  

7/3/2011 7:25:12 AM
Gravatar
Total Posts 92
Нет, я не изменил. До старости глубокой...

Re: grouping profile properties

Hi,

seems many things does not work correctly when using such method, also editor error "undefined coeditor", and i did put doInit for editors in the control, but seems it must be in Resgister.aspx as error say..!

seems I have to override Register.aspx or at least UserProfile.aspx and leave the registration simple..

 

anyway thank you Joe for all your efforts

You must sign in to post in the forums. This thread is closed to new posts.