benvegiard
Programmer
I have a custom web control that contains a few text boxes and drop down lists and validators for these controls. I am validating good date/numeric data is being entered and that it is within tolerable ranges using custom validators. These validators are having to work with multiple controls for some comparisons, so I have not used regular expression validators.
My application deals with a mother and her children. As any given mother could have between one and 20 (grin) kids, the page has to dynamically create the children sections. That is where this webusercontrol comes in.
The problem is that the validation controls do not display their message to the user. However, when I query the Page.Validators collecgtion, I find that these validator controls ARE in the collection and DO return an .IsValid = false as expected.
Does anyone have any experience with this type of scenario? How can I get the validatior ErrorMessages to show when IsValid = false?
A few details:
- Some of the validators have a ControlToValidate assigned, and some do not. This does not appear to affect the display of the error message.
- The webusercontrol is stored to session cache prior to a postback and is then read back in and the controls readded to the controls array during page_load and ispostback = true. I have put a breakpoint here and find that the validators retained IsValid = false correctly after this process. I have even manually called the Validate methods of each validator during this process in hopes that it would force the display of the text. No luck.
- Some validators are displayed Dynamic and some Static. This did not help.
I’m happy to post any code and answer any clarifying questions!
Thanks!
Ben
My application deals with a mother and her children. As any given mother could have between one and 20 (grin) kids, the page has to dynamically create the children sections. That is where this webusercontrol comes in.
The problem is that the validation controls do not display their message to the user. However, when I query the Page.Validators collecgtion, I find that these validator controls ARE in the collection and DO return an .IsValid = false as expected.
Does anyone have any experience with this type of scenario? How can I get the validatior ErrorMessages to show when IsValid = false?
A few details:
- Some of the validators have a ControlToValidate assigned, and some do not. This does not appear to affect the display of the error message.
- The webusercontrol is stored to session cache prior to a postback and is then read back in and the controls readded to the controls array during page_load and ispostback = true. I have put a breakpoint here and find that the validators retained IsValid = false correctly after this process. I have even manually called the Validate methods of each validator during this process in hopes that it would force the display of the text. No luck.
- Some validators are displayed Dynamic and some Static. This did not help.
I’m happy to post any code and answer any clarifying questions!
Thanks!
Ben