My dropdownlist having data from database added with the following item:
DropDownList.Items.Insert(0, new ListItem("Please select", "0"));
My dropdownlist is inside of updatepanel. The autopostback=true is required.
The code is like following:
<asp:DropDownList ID="DropDownList" AppendDataBoundItems="True" runat="server"
DataTextField="Description" DataValueField="CommonCodeId" TabIndex="4"
CssClass="drop_red_style1" AutoPostBack="True" CausesValidation="True"
OnSelectedIndexChanged="DropDownList_SelectedIndexChanged">
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator" runat="server" ControlToValidate="DropDownList"
Display="Dynamic" InitialValue="0" SetFocusOnError="true" ValidationGroup="Registration">Required</asp:RequiredFieldValidator>
Please guide me how to keep the required field validator message.
View Complete Post