<div>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem Value="0" Selected="True">Select Letter</asp:ListItem>
<asp:ListItem Value="A">A</asp:ListItem>
<asp:ListItem Value="C">B</asp:ListItem>
<asp:ListItem Value="C">C</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropDownList1" InitialValue="0"
SetFocusOnError="true" ErrorMessage="Select the Letter"></asp:RequiredFieldValidator>
SetFocusOnError="true" ErrorMessage="Select the Letter"></asp:RequiredFieldValidator>
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
</div>
Note:-
Server
Error in '/' Application.
WebForms
UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please
add a ScriptResourceMapping named jquery(case-sensitive).
If you are getting above error…
Copy past following code in web.config
under <configuration> section.
<configuration>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
</appSettings>
</configuration>
No comments:
Post a Comment