Last post Jul 21, 2018 10:08 AM by Abraham Qian
Jul 19, 2018 06:29 PM|tkhan17|LINK
I have a drop down list with names of countries and a list box with different types of season like summer, winter etc In ASP.Net and both of them gets updated from a table in my database in the page_load event. During the Page_load event my drop down list
and list box gets updated with all the available countries and seasons present in the table in the database. My list box changes dynamically after the country is selected in my drop down list. For example, if I choose USA, then season would change dynamically
like fall, winter, summer. Right now it works perfectly. The only thing I want is to add an "ALL" option at the top of my list box if a country is selected which has all the seasons. For example if I choose country "X" in my drop down list and it has all the
weathers present in my database, the list box would have an "ALL" option at the top. Basically the "ALL" option would pop up only when all the seasons during the page_load event matches the seasons after a country is selected.
Jul 20, 2018 01:47 PM|rajesh93180|LINK
Can you please be clear about your question? You are saying that if the country selected in dropdownlist has all the seasons in the database, then you want to load all the seasons along with 'ALL' in the top of list box? How can you determine if you have
all seasons in your database for selected country?
Jul 21, 2018 10:08 AM|Abraham Qian|LINK
According to your description, I am not clear about your requirement.
In my opinion, if the listbox has four seasons. In the top of the listbox will show “All” text which comes from a label. If you indeed want this. I think you could check the listbox item counts in the dropdownlist_selectedindexchanged event handler, and
then we assige the “ALL” text to the label.
If you do not want this, please post more details about your need. It is easily to give you an effective reply if you could post your code and more details.
Feel free to let me know if you have any questions.