locked
getting value on any arbitrary control RRS feed

  • Question

  • User-313574670 posted

    Lets say I wanted to create my own custom validation system.  Is there a way to pull the values from controls without testing whether the control is TextBox or DropDownList, further up the inheritance chain?  It seems there are certain things groups of controls have in common like ".Text" property for text-based controls and ".SelectedValue" for multi-select controls.  Are there any other commonalities like this and how would I go about manipulating them?

    Thursday, November 19, 2009 2:04 PM

Answers

  • User-1635004338 posted

    Hi kevcpu_1,

    Based on my knowledge it cannot be done. The property for Text or SelectedValue is from the validated controls, so you don't know whether it is. You have to check the control type and get from its own property.

    Thanks,

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 24, 2009 9:54 PM