troubleshooting Question

Unable to clear data in Dropdownlist

Avatar of fosiul01
fosiul01Flag for United Kingdom of Great Britain and Northern Ireland asked on
.NET ProgrammingASP.NET
5 Comments1 Solution767 ViewsLast Modified: programming)

Hi, it could be simple, but i am unable to do that,
I have 2 dropdownlist control in a form.

When i will click on dropdownlist1,  - data will show in Dropdown2.

After running the programm, when i first click on Dropdown1 , - related record is showing in Dropdown2  ( which is fine)

now problem is : if i click AGain on Dropdown1 -- > Data will repeat at dropdown2 ( it will show the First click  record + SEcond click record), 2nd dropdown is not clearning the first records it got from First click (dropdown1)

i want to clear the dropdown 2 when user will click again at dropdown 1.

Exampl : when i first click on dropdownlist 1 -- in dropdownlist 2 it will show   1. printer , 2. Paper

      Again - when i will click on dropdownlist1 -- in dropdownlist2, it should show - 1. Pen 2. Book

but instead of showing , pen and book, it will show , 1.printer 2.paper 3.pen

how shall i clear previous data in dropdownlist ?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros