Dropdownlist AppendDataboundItems (first item to be blank)
Posted
by zohair
on Stack Overflow
See other posts from Stack Overflow
or by zohair
Published on 2009-04-08T15:34:27Z
Indexed on
2010/04/05
17:43 UTC
Read the original article
Hit count: 192
Hi,
I have a drop down list inside an update panel that is populated on postback from a sql data source. It has a parameter which is another control. I sometimes need multiple postbacks, but what happens is that each time the update panel refreshes, items are added to the dropdownlist. So the dropdown list ends up having data that is incorrect, or repeated data.
I have the AppendDataboundItems property set to true because I need the first item to be blank.
How can I overcome this problem? Is there another way to have a blank first item?
(This dropdown is in an asp.net2.0 web app, and codebehind is in c#)
Thank you.
© Stack Overflow or respective owner