Common DropDownList Issue
A common DropDownList issue I've seen on many forums and lists is about a DropDownList populating items 2x or not being able to get the selected value on postback when binding to a data source. This is due to the DropDownList having data bound to it again on postback before the form is processed. To prevent this, you will need to ensure that the DropDownList is only bound to data on the initial load of the page.
VB.NET
Private Sub
Page_Load(
ByVal
sender
As Object
,
ByVal
e
As
EventArgs)
If Not
IsPostBack
Then
' Code here to bind data to DropDownList
End If
End Sub
C#
private void
Page_Load(
object
sender,
EventArgs
e)
{
if
(!IsPostBack)
{
// Code here to bind data to DropDownList
}
}
R