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 )

34808 put(a) pogledan, 5 odgovor(a) 15.12.2010. 4:21:46Kreirao(la) ahung_nt
ahung-nt

ahung_nt

15.12.2010. 4:21:46
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
Ovaj sadržaj još nije ocijenjen. 
0 Reputacija 9 Ukupno objava
khorvat

khorvat

15.2.2011. 13:47:35
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
khorvat

khorvat

16.12.2010. 10:40:44
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
Ocjena 5,00, 1 glas(ova). 
15993 Reputacija 2214 Ukupno objava
ahung-nt

ahung_nt

16.12.2010. 13:17:49
Hi Kristijan Horvat,

Thanks for your help.

-------------------
Best Regards,
HungNavi
Ovaj sadržaj još nije ocijenjen. 
0 Reputacija 9 Ukupno objava
mev9669

mev9669

26.7.2013. 9:39:12
Do you have a sample code for this? i am trying to achieve something similar.

Thanks
Ovaj sadržaj još nije ocijenjen. 
515 Reputacija 67 Ukupno objava