本文介绍了Requiredfield验证程序不适用于下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
requiredfieldvalidator不适用于asp.net的gridview控件的页脚模板中的dropdownlist
我的代码如下:
Hi all,
Requiredfieldvalidator is not working for dropdownlist which is present in footer tamplate of gridview control in asp.net
my code is as follows:
<FooterTemplate>
<asp:DropDownList ID="ddlcustomer" runat="server" AppendDataBoundItems="true" DataSource='<%#GetCustomer() %>'
DataTextField="CustomerName" DataValueField="CusVenID" ValidationGroup ="FtrowValidation">
<asp:ListItem Value="-1">-Select-</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="reqfvCustomerName" runat="server" InitialValue="0" ControlToValidate="ddlcustomer"
ValidationGroup="FtrowValidation" ErrorMessage="select Customer"
Display="Dynamic" Text ="*"></asp:RequiredFieldValidator>
</FooterTemplate>
请告诉我.
please advise me.
推荐答案
这篇关于Requiredfield验证程序不适用于下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!