I’m sure you might have faced this problem or might have seen people asking this on various forums.
There’s no good solution to it. But this is how I usually do it. I have used a ListBox in this example, but would work for any other control too.
Modify your server side code in the following manner:
Run the code and see how it works.
How This Works