We help IT Professionals succeed at work.
Get Started

Updating a Select2 dropdownlist on page postback is not displaying the changes

Last Modified: 2020-07-16
I am using an asp.net dropdownlist converted into a Select2 dropdownlist.

It works perfectly and I use it throughout the site.

But on this particular page, I want to change the icon from a printer to a checkmark after they have selected and downloaded the file for that row. Kind of an indicator that it is done.

select2 ddl
I can step through the code and it is processing after the file download and changing the icons and recreating the ddl. However, the page itself clientside does not show the changes.
 (I am NOT asking how to put material icons in the select2 ddl, I know how to do that. I know how to build it. I know how to rebuild it.)

I do reissue and load the js for the select2 on every page load, not just the not postback or postback.

Things I've tried that do not work:
I have added an UpdatePanel. I have made the mode of the panel "Conditional"
I have added a postbackhandler for the updatepanel.
I have added postbacktriggers.
I have made the name of the update panel static.
I have tried as someone said in google, to set the ddls to EnableViewState False, and that doesn't work and is tediously slow.
I have tried loading the js for this in the js pageLoad() function rather than the documentready. Doesn't work at all for a select2.

Anyway, those are what I've tried. If you see something new that I can try, please share it.

Watch Question
This question hasn't been answered yet.
While you wait, find out how you can maximize your capability with the most trusted tool in IT.
Explore More Ask a Question
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE