Click here to Skip to main content
16,012,025 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
can anyone clear my doubt of how to write the select query for matching 2 control's value.say, radiobuttonlist and textbox.
i.e. if the value of 2 controls match then it should retrieve a field from a database table.
Posted

1 solution

Try this:

C#
string txtvalue=textbox1.text;
string radiovalue=radio1.SelectedItem.Value;
if(txtvalue==radiovalue)
{

//your select query
}


hope it helps :)

for further queries comment here!
 
Share this answer
 
v2
Comments
kwhiterosek 8-Sep-11 11:40am    
thats ok. but the textbox should fire up the datalist control if a particular index value in radiobuttonlist is selected and also textbox1.text should be got at runtime which is a field in the db table.
kwhiterosek 8-Sep-11 12:23pm    
For which event should i write this code???
Uday P.Singh 8-Sep-11 12:51pm    
you can write your code at selectedindexchanged event of radiobuttonlist.
kwhiterosek 9-Sep-11 6:07am    
in codebehind file or as script?

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