|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Drop Down Box Validation ProblemI am using Visual Web Developer 2005 Express Edition.
There is a drop down box on a webform that I would like to have validated by a required field validation control. The first item in the list simply says "Select..." Currently the required form validation control allows "Select..." as a valid option. How can I get the validation control to flag this as an invalid selection and require another item to be selected before submitting the form? Thanks, Owen try this:
<asp:DropDownList ID="ddl2" ValidationGroup="Validate" AutoPostBack="false" Visible="true" runat="server" /> <asp:RequiredFieldValidator ID="vlddl2Required" Text="Required" ControlToValidate="ddl2" ErrorMessage="Select" ValidationGroup="Validate" runat="server"></asp:RequiredFieldValidator> <asp:RangeValidator ID="vlddl2Range" ControlToValidate="ddl2" ErrorMessage="Select a Company" MaximumValue="15000000" MinimumValue="0" Type="Integer" ValidationGroup="Validate" runat="server" Text="Required"></asp:RangeValidator> Put this on your page where you would like the messages displayed <asp:ValidationSummary ID="vlSummary" ValidationGroup="Validate" ShowMessageBox="true" runat="server" /> sasquatch1***@gmail.com wrote: Show quoteHide quote > I am using Visual Web Developer 2005 Express Edition. > > There is a drop down box on a webform that I would like to have > validated by a required field validation control. The first item in > the list simply says "Select..." Currently the required form > validation control allows "Select..." as a valid option. How can I get > the validation control to flag this as an invalid selection and require > another item to be selected before submitting the form? > > Thanks, > Owen
TemplateBuilder
Nested Properties in a GridView ASP.Net 2.0 remove border around checkboxes Need Help with Control Selection usercontrols and postback GridView Nested in Repeater: How can i capture the RowCommand Opening a browser maximized Gridview problem FormView Update item Help... options added to Select element from clientside automation not working properly with Code Be |
|||||||||||||||||||||||