Click here to Skip to main content
14,830,143 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
i have a radiobuttonlist control and i want to retrieve the data from database using different select query for each selected index.
for eg: if index 0 of radiobuttonlist is selected, it should call a select query and if 1, some other select query.
how to write the code?
i want some general overview and syntax..
Herman<T>.Instance 9-Sep-11 6:28am
what is your real problem?
kwhiterosek 9-Sep-11 6:39am
i dont have pblm.i want to know where and how to write the query?
Herman<T>.Instance 9-Sep-11 6:42am
you have a problem use the onselectedindexchanged event of the radiobuttonlist or you do not know how to write te sql query?

1 solution

Do this in RadioButtonList1_SelectedIndexChanged event
1. Set AutoPost Back property = true
2. In RadioButtonList1_SelectedIndexChanged event do this

if (RadioButtonList1.SelectedValue == "0")
     //select query
else if (RadioButtonList1.SelectedValue == "1")
    //select query
//and so on

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900