I have a web-form in which there are three drop downs as shown below in the image:
The form in the above image has 3 drop-down (Physical persons responsible for operations, Resident, Staff) and my task is that if nothing is selected it should display a warning message Please Select an Instrument Type
The .aspx code which I have used in order to achieve that is:
<asp:DropDownList ID="ddlInstrumentType2" runat="server" AutoPostBack="true">
</asp:DropDownList>
<asp:Label ID="InstrumentTypeSelected" runat="server" Visible="true"></asp:Label>
<asp:Image class="helpicon" ID="imgSelInst" runat="server" ImageUrl="~/images/help2.png" ToolTip="imgSelInst"/>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" InitialValue="--------- Select Instrument Type ---------" ControlToValidate="ddlInstrumentType2"
ErrorMessage="Please select an Instrument Type" ValidationGroup="vgrp1">*
</asp:RequiredFieldValidator>
The above code doesn't seems to validate as it doesn't display any warning message if I don't select anything from the dropdown. I am wondering what mistake I am doing and what changes I need to do in the above code so that it successfully displays warning if I don't select any dropdown.
