Mr_Shaw
asked on
ValidationExpression
I am trying to configure my regular expression validation control to make sure that the use either selects Yes or No.
I have tried to configure the expression as
ValidationExpression="{Yes |No}"
But it does not seem to work
I have tried to configure the expression as
ValidationExpression="{Yes
But it does not seem to work
What type of control are you using? If you are using a radiobuttonlist control, just us a required field validator. If you are using a dropdownlist with a blank option, just use a required field validator. If you are using a TextBox control, switch to a radiobuttonlist or dropdownlist. No need for a regularexpressionvalidator for Yes/No options.
ASKER
I am using a dropdown list.
The list items are:
--Please Select--
Yes
No
The list items are:
--Please Select--
Yes
No
ASKER
Ok.. It looks like I can achieve it using the following
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="DropDow nList_WasR eferralRev iewed"
ErrorMessage="RangeValidat or" MaximumValue="Yes" MinimumValue="No"></asp:Ra ngeValidat or>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="DropDow
ErrorMessage="RangeValidat
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok i will check it out in the morning..
thanks
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
strickdd,,,, I theory I could use the above code. But one of the items in the list is "--Please Select--" If the user selects the item "--Please Select--" then it would appear as if they have made a selection.
Is this correct?
Is this correct?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks