Scott said:
Can anyone suggest a good reference for Regular Expressions?
http://www.regexlib.com
There's also a focused email listserv, along with regex-focused blogs, at:
http://regexadvice.com/
Or more specifically, I need to check that a user has made a selection from
Drop Down List. The default in my Drop Down List is "[Select a Model]". I
need a Regular Expression to trigger if this default value has not changed.
I don't think you necessarily need a regular expression here. Why not
just use a RequiredFieldValidator?
From "ASP.NET controls make client-side validation a snap"
(
http://builder.com.com/5100-6371_14-1052985-2.html):
"The Name and Favorite Color fields are both validated with
RequiredFieldValidator control. You’ve already seen how it can be used
to validate the contents of a TextBox, but what about a DropDownList
control? RequiredFieldValidator works by comparing the value of the
control it is validating against the value it holds internally in its
InitialValue property, which is an empty string (“”) by default. So as
long as a DropDownList’s initially selected item has a value that’s
equal to the InitialValue property of its associated
RequiredFieldValidator, everything will work as expected. You can see
this in action in the code snippet below:
ColorValidator.ControlToValidate = cboColor.ID;
ColorValidator.ErrorMessage = "Please pick a color";
ColorValidator.InitialValue = cboColor.SelectedItem.Value;
"
Happy Programming!
--
Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
* When you think ASP.NET, think 4GuysFromRolla.com!