I have this logic in the page_load:
If Not Page.IsPostBack Then
GridView1.DataBind()
End If
If
DropDownList1.SelectedIndex.Equals(0) And
DropDownList2.SelectedIndex.Equals(0) Then
DATA.SelectCommand = ("SELECT * FROM [ATABLE]")
GridView1.DataBind()
ElseIf Not DropDownList1.SelectedIndex.Equals(0) And DropDownList2.SelectedIndex.Equals(0) Then
DATA.SelectCommand = ("SELECT * FROM [ATABLE] where AFIELD = '"
& DropDownList1.SelectedValue.ToString & "
' ")
GridView1.DataBind()
ElseIf
DropDownList1.SelectedIndex.Equals(0) And Not DropDownList2.SelectedIndex.Equals(0) Then
DATA.SelectCommand = ("SELECT * FROM [ATABLE] where BFIELD = '"
& DropDownList2.SelectedValue.ToString & "
' ")
GridView1.DataBind()
ElseIf Not DropDownList1.SelectedIndex.Equals(0) And Not
DropDownList2.SelectedIndex.Equals(0) Then
DATA.SelectCommand = ("SELECT * FROM [ATABLE] where AFIELD = '"
& DropDownList1.SelectedValue.ToString & "
' and BFIELD = '" & DropDownList2.SelectedValue.ToString & " ' ")
GridView1.DataBind()
End If
Once I removed this code, the update worked. Where should I put this code so that it doesn't interfere with the update?