Phanindra Kumar
Phanindra Kumar

Reputation: 169

dropdownlist usercontrol

How to change dropdownlist seleted index in C#. I am binding dropdownlist in usercontrol.

seleted value should change form page to page .

I am doing this but return -1

in aspx page i am find contorl tryint to change seleted index

DropDownList ddl = (DropDownList)ucSearchControl1.FindControl("ddlSearchType");

ddl.SelectedIndex = 2;

Upvotes: 0

Views: 192

Answers (1)

user1102001
user1102001

Reputation: 707

you can use selectedindex_changed event for dropdownlist. so wherever you select item it will fire this event and it will give you selected item's index.

Upvotes: 2

Related Questions