customize mojoMembershipProvider

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/14/2013 3:19:21 AM
Gravatar
Total Posts 39

customize mojoMembershipProvider

Hi,

I want to add new field in registration page with db validation(whether valid data provided or not, like email validation). Where can i validate that field before insert the data in db.

I validated the field in "RegisterUser_CreatingUser" method in register.aspx.cs file but its not happening.

finally, i found validations are done in "mojoMembershipProvider" class "createuser" method.

i,e,

 public override MembershipUser CreateUser(
            string userName,
            string password,
            string email,
            string passwordQuestion,
            string passwordAnswer,
            bool isApproved,
            object providerUserKey,
           out MembershipCreateStatus status).

Where this method is called from and how can i pass additional params to this method.

or, how to handle this field validation ?

5/14/2013 7:34:40 AM
Gravatar
Total Posts 2214

Re: customize mojoMembershipProvider

Hi,

It sounds like you have modified the RegisterUser_CreatingUser method. Please do not do this. Modifying mojoPortal code is forking the code and leaves you (and your clients) without a smooth upgrade path and without support from this community.

You can easily add fields to the registration page and validate them (using regex) by following the instructions here.

HTH,
Joe D.

5/14/2013 7:51:42 AM
Gravatar
Total Posts 39

Re: customize mojoMembershipProvider

Hi,

Thanks for the info.

I have one doubt,

1) How to validate that field with db value on submit. Please give a sample

Thanks

5/14/2013 8:00:04 AM
Gravatar
Total Posts 2214

Re: customize mojoMembershipProvider

Hi,

You can create your own UserControl (implementing ISettingControl) which validates the field based on other values in the DB. An example implementation is /Controls/GMapTypeSetting.ascx, which is used for choosing the map type in features that have Google maps. You can look at /Setup/applications/googlemap/FeatureDefinitions/50020_GoogleMapModule.config for an example configuration.

Using ISettingControl in Module Settings or in User Profiles is very similar. You store a single value in the DB and retreive that same value. You can do whatever you need to with the user-entered value before storing it.

HTH,
Joe D.

5/14/2013 11:37:29 AM
Gravatar
Total Posts 18439

Re: customize mojoMembershipProvider

In addition to what Joe Davis said, my advice is don't modify any mojoPortal code. Doing that will make it impossible to ever upgrade to new versions of mojoPortal without losing your modifications.

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