Button click the selected value is not selectedMPMithun Pradhan4yAsked May 25, 2022, 5:49 AM1kASP.NET
Sachin Singh4y agoPosted May 25, 2022, 8:01 AMshow us your service is it returning properties name Test1 and Test2. And I am talking about properties not about values.
MPMithun Pradhan4y agoPosted May 25, 2022, 7:51 AMNot workingthe slected item is disapear my code----------------- DropDownListCaseType.DataSource = service;DropDownListCaseType.DataTextField = "Test1";DropDownListCaseType.DataValueField = "Test2";DropDownListCaseType.DataBind(); DropDownListCaseType.Items.Insert(0, new ListItem("-Select-", "-1"));
Sachin Singh4y agoPosted May 25, 2022, 7:42 AMfirst make sure, your data value field and Text field are set correctly.DropdownList1.DataSource = items; DropdownList1.DataValueField = "Value"; DropdownList1.DataTextField = "Text"; DropdownList1.DataBind(); 2nd fetch value asDropdownList1.SelectedItem.Value;
Sachin SinghPosted May 25, 2022, 8:01 AM
Mithun PradhanPosted May 25, 2022, 7:51 AM
Sachin SinghPosted May 25, 2022, 7:42 AM