Dropdownlist selected Item
-
hi, I have a DropdownList called as ddItems.I am populating this dropdown with the Item names from the Database.I have a textbox called as txtName. Now I want to display the name of the Item in the textBox txtname depending on the value selected from the dropdownlist box ddlItems. The code i am using is string selvalue = ddlItems.SelectedItem.Value; txtName.Text = selvalue; But it always displays the first value from the dropdownlist in the textbox. Plz help me.I am using ASP.Net and C#. Riz -- modified at 0:56 Tuesday 28th February, 2006
-
hi, I have a DropdownList called as ddItems.I am populating this dropdown with the Item names from the Database.I have a textbox called as txtName. Now I want to display the name of the Item in the textBox txtname depending on the value selected from the dropdownlist box ddlItems. The code i am using is string selvalue = ddlItems.SelectedItem.Value; txtName.Text = selvalue; But it always displays the first value from the dropdownlist in the textbox. Plz help me.I am using ASP.Net and C#. Riz -- modified at 0:56 Tuesday 28th February, 2006
this can be done by using js << >>
-
this can be done by using js << >>
Hey, Thanks for the response.This is very urgent for me.If u have any js code for it then plz send it to me. Dropdownlist is always displaying the first record and same gets populated in the textbox.The selected Index of the texbox is always zero even after selecting he items from the dropdownlist......am trying to break my head on this. Thanks riz
-
Hey, Thanks for the response.This is very urgent for me.If u have any js code for it then plz send it to me. Dropdownlist is always displaying the first record and same gets populated in the textbox.The selected Index of the texbox is always zero even after selecting he items from the dropdownlist......am trying to break my head on this. Thanks riz
You can write a small function js code to hook on Onchange event of drop down list then, in the function, just simply get the selected value from drop down list and assign to the text box << >>
-
hi, I have a DropdownList called as ddItems.I am populating this dropdown with the Item names from the Database.I have a textbox called as txtName. Now I want to display the name of the Item in the textBox txtname depending on the value selected from the dropdownlist box ddlItems. The code i am using is string selvalue = ddlItems.SelectedItem.Value; txtName.Text = selvalue; But it always displays the first value from the dropdownlist in the textbox. Plz help me.I am using ASP.Net and C#. Riz -- modified at 0:56 Tuesday 28th February, 2006
Hi, I guess you forgot to put the IsPostBack check in ur page load event that's why it populating your combobox during everypost back and ur getting the first value... Regards, Ritesh
-
hi, I have a DropdownList called as ddItems.I am populating this dropdown with the Item names from the Database.I have a textbox called as txtName. Now I want to display the name of the Item in the textBox txtname depending on the value selected from the dropdownlist box ddlItems. The code i am using is string selvalue = ddlItems.SelectedItem.Value; txtName.Text = selvalue; But it always displays the first value from the dropdownlist in the textbox. Plz help me.I am using ASP.Net and C#. Riz -- modified at 0:56 Tuesday 28th February, 2006
Hi, how ur populating dropdownlist, 1st check that one. if u r populating at page_load, plz write ur code under this condition if(!IsPostBack) { //populate ur DropDownList } then u can write string selvalue = ddlItems.SelectedItem.Value; txtName.Text = selvalue; in SelectIndexChanged event. Bye Pessi
-
Hi, how ur populating dropdownlist, 1st check that one. if u r populating at page_load, plz write ur code under this condition if(!IsPostBack) { //populate ur DropDownList } then u can write string selvalue = ddlItems.SelectedItem.Value; txtName.Text = selvalue; in SelectIndexChanged event. Bye Pessi
-
hi, I have a DropdownList called as ddItems.I am populating this dropdown with the Item names from the Database.I have a textbox called as txtName. Now I want to display the name of the Item in the textBox txtname depending on the value selected from the dropdownlist box ddlItems. The code i am using is string selvalue = ddlItems.SelectedItem.Value; txtName.Text = selvalue; But it always displays the first value from the dropdownlist in the textbox. Plz help me.I am using ASP.Net and C#. Riz -- modified at 0:56 Tuesday 28th February, 2006
-
hi, Thanks a lot, i had not included the IsPostBack on the Page load.Now it's working fine.....:) Riz