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