Click here to Skip to main content
15,913,091 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to display same drop down list with different queries based on selecting menu on same page
there are 2 menus defines in site master
1. request
2. request dc

when i click request display dropdown with 4 listitems
when i click request display dropdown with 2 listitems


on same page

how to do it?

What I have tried:

if( )
{
query
}
else
{

}
Posted
Updated 7-Jan-19 19:49pm
Comments
Prifti Constantine 2-Jan-19 8:18am    
Can you provide some meaningful Code of your project?
ZurdoDev 3-Jan-19 13:47pm    
This does not make any sense.

you could try the following algorithm:
*when clicked 'request'
1. Clear all items from dropdown list.
2. add the 4 items that you want to display.
*when clicked 'request dc'
1. Clear all items from dropdown list.
2. add the 2 items that you want to display.
 
Share this answer
 
Before binding dropdownlist with its query just clear the items like
1) Dropdownlist.Items.Clear()
2) then your query
3) Dropdownlist.DataBind()
 
Share this answer
 

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