Hi folks,
I have a custom control that is made up of a dropdownlist. I need to
validate this control. I am using the following code in my codebehind:
Imports System.Web.UI.WebControls
.
.
.
<ValidationPropertyAttribute("ClassDropDown")> Public Class
ClassDropDown
Inherits System.Web.UI.UserControl
Public WithEvents ClassDropDown As
System.Web.UI.WebControls.DropDownList
.
.
.
And on the front side I have:
<td><asp:label id="Label1" runat="server" Font-Bold="True"
text="Class"></asp:label></td>
<td><uc1:classdropdown id="ClassDropDown1"
runat="server"></uc1:classdropdown></td>
<td colspan="2"><asp:RequiredFieldValidator id="validateClassDropDown"
runat="server" ControlToValidate="ClassDropDown1" ErrorMessage="Please
Select A Class" Display="Dynamic" InitialValue="Select Class"
Width="100%"></asp:RequiredFieldValidator></td>
My first impression is that I cannot have the validation property be a
dropdownlist?! There are no examples of using a dropdownlist as the
validation property anywhere that I can find. Any suggestions would be
greatly appreciated!
thanks,
Greg
Greg Partin
Software Engineer
CompassLearning, Inc.
2400 N. Commerce Pkwy.
Suite #404
Weston, FL 33326