The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: How to Bind Country, State, City using Ajax Update Panel
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

vishnu vardhanPosted Apr 7, 2014, 2:12 AM
I am working on some project there i have 2 drop down lists and one Textbox in Update panel1. here i am binding the Names of PG from database to dropdownlist1(DDPGNames) and binding the PG rooms to dropdownlist2(DDRoomNumber) based first dropdownlist (it's like Country and state thing) now if i select any Room number in 2nd Dropdownlist the room rent has to dispaly automatically in textbox. for this i am writing this code on DDRoomNumber SelectIndexChanged Event. but my problem is DDRoomNumber is not taking selected room Number (It is taking Only First Value) if i select any other room in dropdown list it's going first one only. see here my code: protected void DDRoomNumber_SelectedIndexChanged(object sender, EventArgs e) { txtRent.Enabled = true; MySqlConnection Con = new MySqlConnection(MyConString); MySqlCommand Cmd = Con.CreateCommand(); string S = "SELECT*FROM pg_room_list WHERE Room_Num ='" DDRoomNumber.SelectedItem.Text "' AND Room_PG_ID ='" DDPGNames.SelectedValue "';"; Cmd = new MySqlCommand(S, Con); MySqlDataReader Dr; Con.Open(); Dr = Cmd.ExecuteReader(); while (Dr.Read()) { string SRoom_Rent = Dr.GetString("Room_Rent"); txtRent.Text = SRoom_Rent; } Con.Close(); } Pls give me some solution. Thanks
Yogendra KumarPosted Apr 4, 2013, 1:00 PM
Thanks Tanuj
Tanuj KhuranaPosted Nov 11, 2012, 12:05 PM
thanks....this post is good...
joPosted Jul 20, 2011, 3:21 AM
please can you help me regarding the sql database and tables you have created for this article? Thanks in advance
Prateek NarangPosted May 12, 2011, 2:57 AM
Hi Guys This is working Fine but i think in this senario there is no need to add Triggers with update panel as below: <Triggers > <asp:AsyncPostBackTrigger ControlID ="ddlcity" /> </Triggers> It doesnt craete any problem but it is not needed here. Try to use without trigger and please reply .