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.

How to have a custom register page?  (Mono Support )

Viewed 33854 time(s), 5 post(s) 12/15/2010 4:21:46 AMby ahung_nt
ahung-nt

ahung_nt

12/15/2010 4:21:46 AM
Hi,

I want to have my custom page. I need more information in register page for users such as avatar, city, sex, career, and others. Is there some way to do this? or which class, method to do this. Thanks,

-------------
Best Regard
HungNavi
This content has not been rated yet. 
0 Reputation 9 Total posts
khorvat

khorvat

2/15/2011 1:47:35 PM
Hi HungNavi,

I'll try to describe the best practice procedure of doing this in few short steps:

1. In root folder of the CMS create your project specific folder (in most cases we name it by the name of the project)
2. As we will be working with the Membership web part we need to create a sub folder called WebParts (to distignuish ordinary UserControls from WebParts )
3. Copy the "MembershipEditor.ascx" WebPart from the "\Portal\MonoX\ModuleGallery\Membership\MembershipEditor.ascx" to your web parts folder
4. Create your code behind file that will hold all your custom code etc. (don forget to change the "Inherits" property inside the mark-up of "MembershipEditor.ascx")
5. In the mark-up file you can add your own controls (city, etc.) e.g.

<asp:PlaceHolder ID="plhNewsletter" runat="server">
<dd style="margin: 0px; padding: 0px;">
<label> </label>
<asp:CheckBox ID="chNewsletter" runat="server" />
<label style="width: 60%; margin: 0px; padding: 0px; display: inline; text-align: left;" for="<%= chNewsletter.ClientID %>"><%= Resources.DefaultResources.Registration_Label_NewsletterSubscription %></label>
</dd>
</asp:PlaceHolder>
<asp:PlaceHolder ID="plhRememberMe" runat="server">
<dd style="margin: 0px; padding: 0px;">
<label> </label>
<asp:CheckBox ID="chkRememberMe" runat="server" />
<label style="width: 60%; margin: 0px; padding: 0px; display: inline; text-align: left;" for="<%= chkRememberMe.ClientID %>"><%= Resources.DefaultResources.MembershipEditor_RememberMe%></label>
</dd>
</asp:PlaceHolder>


6. Now you need to state that your class inherits from the "MonoSoftware.MonoX.ModuleGallery.MembershipEditor" e.g. "public partial class MembershipEditor : MonoSoftware.MonoX.ModuleGallery.MembershipEditor"

7. To execute your custom code you need to attach to some of the exposed events:

AccountCreating
AccountCreated
AccountCreationCompleted
AccountUpdating
AccountUpdated
AccountUpdateCompleted


To read more about this event please download MonoX API reference from here http://www.mono-software.com/Download/MonoX.chm.zip.

e.g.

void MembershipEditor_AccountCreated(object sender, MembershipModuleEventArgs e)
{
  AddUserToRole(e);
  PostAccountCreationActions(new Guid(e.MembershipUser.ProviderUserKey.ToString()));
  SendNotifications(e);
  AddUserProfile(new Guid(e.MembershipUser.ProviderUserKey.ToString()));
}


8. for all of your custom data we advise you to store that data in your own (separate) DB table

If you have any questions or you need clarification on how to do any of the described actions do not hesitate to contact us.

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

khorvat

12/16/2010 10:40:44 AM
One more thing I forgot to mention is that if you want a custom profile page (module) please refer to the following http://www.mono-software.com/blog/post/Mono/38/Support-for-ASP-NET-profiles-in-MonoX/

Regards
Rated 5.00, 1 vote(s). 
15993 Reputation 2214 Total posts
ahung-nt

ahung_nt

12/16/2010 1:17:49 PM
Hi Kristijan Horvat,

Thanks for your help.

-------------------
Best Regards,
HungNavi
This content has not been rated yet. 
0 Reputation 9 Total posts
mev9669

mev9669

7/26/2013 9:39:12 AM
Do you have a sample code for this? i am trying to achieve something similar.

Thanks
This content has not been rated yet. 
515 Reputation 67 Total posts