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
170
How can I get Selected index/value of a ASP Drop Down, which is in a WebTab on button click?
posted

Hello Team,

I have a WebTab with 3 tabs. and a button on page.

one tab have 2 asp drop downs and a text box.

on page load I bound DDL with 3 items.

Now on button click i am trying to display selected DDL item index and value and text box value.

Text box value displayed on page but every time selected value is blank. because DDL don't have any item.

On post back all items removed from DDL.

How can I get Selected value of a Drop Down which is in a WebTab on button click?

Thanks,

Parents
No Data
Reply
  • 15320
    Offline posted

    Hello yogesh,

    I created a sample that demonstrates WebTab with three tabs and in one of the tabs there are dropdown and textbox controls. At the bottom of the WebTab control there is a button, which has click event attached. On button click the respective dropdown item's value and textbox entered text are shown in two labels. Please note that the dropdown list is populated only on the first page load and on subsequent postbacks the currently selected dropdown item is persisted and could be obtained on button click. Otherwise if you populate the dropdown list on every postback, every time the page is refreshed it will display the same value (selected by default) and the previous selection will be cleared.

    Attached is a sample with similar scenario for your reference.

    Please take a look at it and let me know if it helps you resolving your issue.

    Regards,

    Tsanna

    getSelectedDropDownIndex.zip
Children
No Data