Tuesday, August 18, 2020

How to set selected item in multiple dropdown dynamically in asp.net

We can set selected item in multiple dropdown list by using two methods.

1. FindByText

2. FindByValue

FindByText : 

In FindByText method search item by text and set selected.

dorpdownId.Items.FindByText("Some Text").Selected = true;

FindByValue : 

In FindByValue method search item by value and set selected.

dorpdownId.Items.FindByValue("your value").Selected = true; 

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...