G
Guest
I am applying the ValidationProperty property to a modified custom control
that I am using:
[
ValidationProperty("Text")
]
public class ComboBox : System.Web.UI.WebControls.ListControl,
IPostBackDataHandler, INamingContainer
{
According to the Microsoft docs, this should be sufficient to expose the
Text property for required and other types of validation.
My required validator renders correctly, but no client side validation occurs:
<mbcbb:combobox id="cbStates" CssClass="ComboBox" runat="server"
TextCssClass="TextBox" ButtonCssClass="ButtonSystem"></mbcbb:combobox>
<asp:requiredfieldvalidator id="vreqStates" CssClass="errors" runat="server"
Display="Dynamic" ControlToValidate="cbStates">*</asp:requiredfieldvalidator>
I also tried ValidationPropertyAttribute instead of ValidationProperty, but
it did not work.
Is there any method in my custom control that I need to watch closely when
overriding? Please advise, thanks.
that I am using:
[
ValidationProperty("Text")
]
public class ComboBox : System.Web.UI.WebControls.ListControl,
IPostBackDataHandler, INamingContainer
{
According to the Microsoft docs, this should be sufficient to expose the
Text property for required and other types of validation.
My required validator renders correctly, but no client side validation occurs:
<mbcbb:combobox id="cbStates" CssClass="ComboBox" runat="server"
TextCssClass="TextBox" ButtonCssClass="ButtonSystem"></mbcbb:combobox>
<asp:requiredfieldvalidator id="vreqStates" CssClass="errors" runat="server"
Display="Dynamic" ControlToValidate="cbStates">*</asp:requiredfieldvalidator>
I also tried ValidationPropertyAttribute instead of ValidationProperty, but
it did not work.
Is there any method in my custom control that I need to watch closely when
overriding? Please advise, thanks.