how to use dropdown and checkbox in asp.net

Posted by Shail under ASP.NET AJAX on 3/3/2013 | Points: 10 | Views : 4091 | Status : [Member] | Replies : 4
hello sir
i am create home page that i have dropdownlist as ammount and multiple checkbox as location such as(Delhi,Lucknow .............) that i want if user select ammount and any location then filter all details selected all field such as (user select dropdown ammount 50lakhs and checkbox checked Delhi) then filter all record in home page.
plz help me any my senior sir
Thanks
Shail




Responses

Posted by: Santhi on: 3/3/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

Do you need how to use dropdownlist control and checkbox control in asp.net?
If i am right.
This is an example of how to use those controls.
Try these steps:
Drag a dropdownlist and checkbox list control on the aspx page.
You need to get the selected values of dropdownlist and checkbox.
So,
To get the dropdownlist selected value.

Write this code.
DropdownlistID.SelectedItem.ToString();
DropdownlistID refers your controlid
To get the checked item from the checkbox list control.
foreach(object itemChecked in checkedListBox1.CheckedItems) {
itemChecked.ToString()
}


Thanks & Regards,
Santhi .V

Shail, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Somu475 on: 3/3/2013 [Member] Starter | Points: 25

Up
0
Down
Hi Shail,

Which data you want to filter on selecting any items from Amount DropDownList and Location CheckBoxList..??
Can you explain it clearly...?

-Somu

Shail, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shail on: 3/4/2013 [Member] Starter | Points: 25

Up
0
Down
Hi somu475
my ques is i have two dropdownlist 1 is min budget 2 is max budget and multiple checkbox such as( delhi,lucknow) and datalist in masterpage if user select any mix or max ,both budget and location then all details filter and show default page
i have two table
tblProject Details
PId,LocIdPName,Fromsize,Tosize,budget
tblLocation
LocId
LocName,



Shail, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhi on: 3/5/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

I think you need query to do this thing.
If i am right.
This will be the query.
Are you referencing LocIdPName in the second table LocId as foreign key.
If yes.
Then you need to pass the values in the where condition
For example:
Select columnnames from tblprojectdetails 

join tbllocation
on locidpname = locid
where budget =values
and locid = values
Here values refer to the values which you need to pass from the UI.(i.e.,) dropdownlist value and checkbox list values



Thanks & Regards,
Santhi .V

Shail, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response