Profile property validation error message?

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.
12/4/2008 3:03:34 PM
Gravatar
Total Posts 55

Profile property validation error message?

Hi!

I have a little problem with profile property validation error message. I use custom property (business identifier) defined in mojoProfile.config as follows:

<add name="BizID"
type="System.String"
resourceFile="ResourceKSKS"
labelResourceKey="BizID"
lazyLoad="false"
requiredForRegistration="false"
visibleToAnonymous="false"
visibleToAuthenticated="false"
visibleToUser="true"
editableByUser="false"
regexValidationExpression="^\d{7}$|^\d{13}$"
validationErrorResourceKey="ErrBizID"
onlyAvailableForRoles=""
onlyVisibleForRoles=""
defaultValue=""
includeHelpLink="false"
maxLength="13"/>

As can be seen in bold, I use separate resource files (English and Croatian) for this property. Property Title - BizID resource - is displayed properly. However, validation error message - ErrBizID resource - is not. Validation does occur, wrong values do not get saved, and even empty space appears beneath textbox for BizID value, empty space that presumably should contain error message, but it does not, it remains empty instead.

What am I doing wrong?

It's not some crucial problem but it's certainly annoying, so please help.

12/6/2008 1:23:22 PM
Gravatar
Total Posts 18439

Re: Profile property validation error message?

I will look into this and see if I can reproduce the problem. I reviewed the code and it seems correct. Have you tried changing the content of that key in the resource file to see if maybe it has any bad characters, or try pointing it to some included resource and see if it makes it display or has the same problem.

Best,

Joe

12/8/2008 1:39:14 AM
Gravatar
Total Posts 55

Re: Profile property validation error message?

Sorry for delay. I'll try to point it to included resource ASAP and let you know the results.

Cheers!

12/10/2008 3:28:02 PM
Gravatar
Total Posts 55

Re: Profile property validation error message?

I've finally tried as you suggested but puzzle remains. Validation error message still doesn't get displayed, even after embedding resources into ProfileResource.* files and renaming resource names.

Could you, well, point to the class where mojoProfile.config is being read so that I can run it through debugger? I have to admit that I can't find that class.

12/11/2008 6:13:08 AM
Gravatar
Total Posts 18439

Re: Profile property validation error message?

Hi Slaven,

The relevant code should be in Web/Components/mojoProfileConfiguration.cs and mojoProfilePropertyDefinition.cs

Though you could set a breakpoint in the profile page code behind as well and step into it to see whats happening.

Please let me know what you find out, hopefully you can send me a fix.

Best,

Joe

12/11/2008 1:34:14 PM
Gravatar
Total Posts 55

Re: Profile property validation error message?

Ummm...it was my stupid error. However, this part of documentation should be updated. 

I wrote:

validationErrorResourceKey="ErrBizID"

...but it should be:

regexValidationErrorResourceKey="ErrBizID"

So, "problem" is solved.

12/11/2008 2:25:43 PM
Gravatar
Total Posts 18439

Re: Profile property validation error message?

My bad on the incorrect documentation, it led you down the wrong path.

Good job on finding the problem, I've corrected the documentation page.

I can almost remember when I first implemented this I originally named it validationErrorResourceKey and then changed it to be more clear which kind of validation it would be used for.

Best,

Joe

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