Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
how to validate webcombo?
posted

Hi all,

 

I have a asp.net form, inside has a webcombo, I placed a requiredfieldvalidator and want to validate it, but cannot choose the webcombo control inside the requirefieldvalidator.

 

Can you suggest me how to ensure user choose a value in webcombo before submit the form?

 

Thank you very much for your help! Happy new year! 

Parents
No Data
Reply
  • 294
    posted

    The UltraWebCombo does not have the typical attribute of a control such as:

     

    [ValidationProperty("DataValue")]

     

    which enables a required field validator to work.   In hindsight this makes sense because depending on your usage of the control (for instance, a user can type in free text) DisplayValue is correct versus DataValue.   So, what you really want to do is use a custom validator on the webcombo.   This gives you the latitude to interrogate whichever attribute is your (mental) appropriate Validation Property of interest.

Children