Error rendering Validator control
Hello,
I have a composite control that has a validator in it, but the weird thing is, I have another composite control and the validator works in one, but not in the other. I have the same settings (just copied over); I can't figure it out. In CreateChildControls I have:
rfvSearchText = New RequiredFieldValidator
With rfvSearchText
.ID = "rfvSearchText"
.Display = ValidatorDisplay.Static
.Text = "*"
.ErrorMessage = "Please enter search text"
.ToolTip = .ErrorMessage
.ControlToValidate = txtSearchText.ID
End With
And in the Render method, I render it as such:
If (Me.SearchTextRequiredErrorMessage <> String.Empty) Then
rfvSearchText.RenderControl(writer)
End If
It renders, but it shows by default, whereas the other one is hidden. Any idea why the * appears by default? This is at runtime, not design time. The * appears for the first control, but it properly hides it for the second one.
Thanks.
Brian
__________________
Brian
|