S
Stuart Whiteford
Guys,
I have a custom validator that has the default property ControlToValidate
plus one called SecondControlToValidate that I have created, like so...
<ows:eitherorvalidator id="eovNumberName" runat="server"
ControlToValidate="txtNumber" SecondControlToValidate="txtName"
EnableClientScript="True"></ows:eitherorvalidator>
....in my Validator Class I have the following...
Protected eitherOrSecondControlToValidate As String
Public Property SecondControlToValidate() As String
Get
Return eitherOrSecondControlToValidate
End Get
Set(ByVal Value As String)
eitherOrSecondControlToValidate = Value
End Set
End Property
Protected Overrides Sub AddAttributesToRender(ByVal writer As
HtmlTextWriter)
If (Me.DetermineRenderUplevel And Me.EnableClientScript) Then
MyBase.AddAttributesToRender(writer)
writer.AddAttribute("secondcontroltovalidate",
Me.SecondControlToValidate)
End If
End Sub
All this works fine when the textboxes and validator is straight on the
page, but I can't get it working in a Web User Control. I know about
UniqueID and ClientID but what I don't know is how get the ClientID from the
string being passed in so I can use it in the AddAttributesToRender Sub (or
should I be passing in a Control instead).
Mucho head scratching.
TIA,
Stuart.
I have a custom validator that has the default property ControlToValidate
plus one called SecondControlToValidate that I have created, like so...
<ows:eitherorvalidator id="eovNumberName" runat="server"
ControlToValidate="txtNumber" SecondControlToValidate="txtName"
EnableClientScript="True"></ows:eitherorvalidator>
....in my Validator Class I have the following...
Protected eitherOrSecondControlToValidate As String
Public Property SecondControlToValidate() As String
Get
Return eitherOrSecondControlToValidate
End Get
Set(ByVal Value As String)
eitherOrSecondControlToValidate = Value
End Set
End Property
Protected Overrides Sub AddAttributesToRender(ByVal writer As
HtmlTextWriter)
If (Me.DetermineRenderUplevel And Me.EnableClientScript) Then
MyBase.AddAttributesToRender(writer)
writer.AddAttribute("secondcontroltovalidate",
Me.SecondControlToValidate)
End If
End Sub
All this works fine when the textboxes and validator is straight on the
page, but I can't get it working in a Web User Control. I know about
UniqueID and ClientID but what I don't know is how get the ClientID from the
string being passed in so I can use it in the AddAttributesToRender Sub (or
should I be passing in a Control instead).
Mucho head scratching.
TIA,
Stuart.