p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

aspdotnet_website_programming thread: custom validating a dropdown usercontrol

Message #1 by "Greg Partin" <GPartin@c...> on Fri, 21 Jun 2002 12:50:17 -0700
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

    Inherits System.Web.UI.UserControl
    Public WithEvents ClassDropDown As

And on the front side I have:

<td><asp:label id="Label1" runat="server" Font-Bold="True"
<td><uc1:classdropdown id="ClassDropDown1"
<td colspan="2"><asp:RequiredFieldValidator id="validateClassDropDown"
runat="server" ControlToValidate="ClassDropDown1" ErrorMessage="Please
Select A Class" Display="Dynamic" InitialValue="Select Class"

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!


Greg Partin
Software Engineer

CompassLearning, Inc.
2400 N. Commerce Pkwy.
Suite #404
Weston, FL  33326

  Return to Index