0

I have a datatable/source binded to a drop down list in ASP.NET C#.

I am trying to return the selected drop down list value using:

dropdownlist.Text

However, this just returns the first list value. How can i get it to return the selected drop down list value?

3 Answers 3

2

The dropdownlist.Text property should work.

Make sure that you are not binding the list again on Page_Load. This would reset the SelectedValue to the first value.

Use code like

if(!IsPostBack)
{
   //DataBind dropdownlist
}
Sign up to request clarification or add additional context in comments.

Comments

0

Use DropDownList.SelectedValue property instead.

Comments

0

Dropdown can return only one value. For list either you need to customize the dropdown or you need to find third party control to do that.

if You want to do it with 3rd party controls. you can try this


if you want to customize dropdown then view these
1 2

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.