简体   繁体   English

Obout ComboBox 不适用于 RequiredFieldValidator

[英]Obout ComboBox not work with RequiredFieldValidator

The Obout ComboBox, was used like bellow: Obout ComboBox 的用法如下:

<asp:RequiredFieldValidator ID="rfvEndTipoEndereco" runat="server" ControlToValidate="ddlTipoEndereco"
    ValidationGroup="vagIndCad" ErrorMessage="Informe o tipo de endereço" ToolTip="Campo obrigatório">*</asp:RequiredFieldValidator>
    <obout:ComboBox  ID="ddlTipoEndereco" runat="server"    EnableLoadOnDemand="True" 
        MenuWidth="150px" oninit="Init_ComboBox" Width="150px" ></obout:ComboBox>

But it is not working properly, is not validating when the selected value is "".但它不能正常工作,当所选值为“”时未验证。

Which is equal to: https://www.obout.com/interface/aspnet_integration_validators.aspx等于: https : //www.obout.com/interface/aspnet_integration_validators.aspx

I'm not sure about this Obout controls, but when using validators with DropDownLists you should set the InitialValue on the validator to the value you'd like to check against.我不确定这个 Obout 控件,但是当将验证器与 DropDownLists 一起使用时,您应该将验证器上的 InitialValue 设置为您想要检查的值。 For instance:例如:

<asp:RequiredFieldValidator ID="rfvEndTipoEndereco" runat="server" 
ControlToValidate="ddlTipoEndereco"  
ValidationGroup="vagIndCad" 
ErrorMessage="Informe o tipo de endereço" ToolTip="Campo obrigatório"
InitialValue="Select an item">*</asp:RequiredFieldValidator>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM