Web page Drop down list populating

  • Thread starter Thread starter Pete Lux
  • Start date Start date
P

Pete Lux

I have a drop down that populates on page load. The drop down brings in
customer numbers from my local MSDE database. It does this fine, but I click
a button that finds quotes for those customers and the next time I go to
drop down the list, all the customer numbers are doubled
(1015,1016,1017,1015,1016,1017..)

How do I get that to stop? Do I have to check if it's a post back or
something like that?

I'm fairly new at this, if you can't tell..
Thanks!
 
Hello,

Pete Lux said:
I have a drop down that populates on page load. The
drop down brings in customer numbers from my local
MSDE database. It does this fine, but I click a button
that finds quotes for those customers and the next time I go to
drop down the list, all the customer numbers are doubled
(1015,1016,1017,1015,1016,1017..)

How do I get that to stop? Do I have to check if it's a post
back or something like that?

You may want to turn to the ng for ASP.NET Web Controls questions for future
ASP.NET Web Control related questions:

news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet.webcontrols

Web interface:

http://msdn.microsoft.com/newsgroup...ft.public.dotnet.framework.aspnet.webcontrols
 
Two possibilities:

One - The code populating the dropdown list is NOT in an:

If NOT Page.IsPostBack THEN

End If

if so then the list is getting populated every time the page is loaded,
whether postback or no...

Two: On the line BEFORE the code to populate the dropdown list add this:

DropDownList1.Items.Clear()

Then let the code populate the list again.

Severin
 
Herfried,
Please how many times do I have to ask this, dont do that, the answer from
DGeorge is the right one, he never get that in the groups you mentioned.

It is 100% vb.language code.
Cor
 
Hello,

Cor said:
Please how many times do I have to ask this, dont do
that, the answer from DGeorge is the right one,
he never get that in the groups you mentioned.

It is 100% vb.language code.

But the problem is 0% related to VB.NET.

:-)
 
Back
Top