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:

Professional Opinions
Ask a Question
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

troubleshooting Question

.net dropdownlist when does it get populated with data?

Avatar of haloexpertsexchange
haloexpertsexchangeFlag for United States of America asked on
.NET ProgrammingASP.NETVisual Basic.NET
6 Comments1 Solution440 ViewsLast Modified:
I am dynamically setting a dropdown current index in the page_load event and then after that I try to use the currentindex in a function that is called from the page_load event, but when looking at the page index in the function it always comes up as -1. I used the immediate window in debug mode in visual studios to look up the dropdown item count and it comes up as 0. Which to me says that the dropdown has not yet been populated with data to even have its currentindex set or looked up yet.

When does a dropdown list populate with data so that I can use it as I want?

This was driving me nuts trying to figure what the issue was that was causing the index to always show up as -1 even though I can set the selected index to another number and then the dropdown would show the correct item once the page had completely loaded.
Avatar of Jerry Miller
Jerry MillerFlag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answers