Monday, May 11, 2009

Add a default time and make the dropdownlist required (not include that item)

Add a dropdownlist with the value of default item=0:
<asp:dropdownlist id="ddlExample" runat="server" appenddatabounditems="true">
<asp:listitem text="select" value="0"></asp:listitem>
</asp:dropdownlist>

Add a requiredfieldvalidator with the initialvalue=0:

<asp:requiredfieldvalidator id="rfvExample" runat="server" initialvalue="0" controltovalidate="ddlExample" text="select plz">
</asp:requiredfieldvalidator>

No comments: