验证控件验证DropDownList

 

  <tr>
            < td   class ="caption td_caption">
                 免疫程序:
           </ td >
            < td   class ="txtbox td_textbox">
                 < asp : DropDownList   ID ="ddlMYCX"   runat ="server"   Width ="200px"   AutoPostBack ="true"   AppendDataBoundItems ="true"
                                                     OnSelectedIndexChanged ="ddlMYCX_SelectedIndexChanged">
                  </ asp : DropDownList >
                 < asp : CompareValidator   ID ="CompareValidator1"   runat ="server"   Display ="None"   ValidationGroup ="ValidationGroup1"
                                                     ControlToValidate ="ddlMYCX"   Operator ="NotEqual"   Type ="Integer "   ValueToCompare ="0"
                                                      ErrorMessage ="<span class='ErrorMessage'>必须输入选择“免疫程序”</span>"></ asp : CompareValidator >
                  < ajaxToolkit : ValidatorCalloutExtender   runat ="Server"   ID ="Vcompare"   TargetControlID ="CompareValidator1"
                                                     HighlightCssClass ="validatorCalloutHighlight"   />
               </ td >
  </ tr >

你可能感兴趣的:(验证控件验证DropDownList)