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
510
Get/Set the selected value for WebDropDown
posted

How do I get or set the value of a webdropdown control?

Parents
No Data
Reply
  • 24671
    Suggested Answer
    posted

    Hi George,

    1) On the client-side: get_currentValue() and set_currentValue() => this is the current visible value in the input box as well. This could be different from an item's text or value properties, and can actually hold a value to something that doesn't match anything in the items

    2) On the server-side: use the CurrentValue property. Also there is SelectedValue, which must match an item's Value property. A DropDownItem has Text and Value, and a couple of other properties. "Text" is what is visible to the end user, in the dropDown list of items. The SelectedValue property is done in the same way it is implemented for the ASP:DropDownList control. 

    Hope it helps,

    Angel 

Children