Hello PureWeen
Thank you very much for your answer.
I tried all your sugestions, but none worked.
I found the line that's causing the error:
Me.ddImage.SelectedIndex = Me.ddImage.SelectedIndex + 1
Is there another way to get the previous/next record of the dropdownlist?
I have code on the previous button, that is the same, except that I set "selectindex - 1".
And I have code on the SelectedIndexChange, that also has a strange behaviour... The SelectedIndex doesn't change, and It doubles the number of records on the dropdown!!!
Protected Sub ddImage_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddImage.SelectedIndexChanged
Me.frmVal.Attributes("src") = "../ValScans/ValScanSum.aspx?ID=" & Me.ddImage.SelectedValue
Me.frmImage.Attributes("src") = "../ValScans/Image.aspx?ID=" & Me.ddImage.SelectedValue
If Me.ddImage.SelectedIndex = 0 Then
Me.frmVal.Attributes("src") = ""
Me.frmImage.Attributes("src") = ""
End If
If Me.ddImage.SelectedIndex + 1 = Me.ddImage.Items.Count Then
Me.btNext.Enabled = False
Else
Me.btNext.Enabled = True
End If
End Sub
Am I going crazy, or this doesn't make any sense???
When I run the page without getting a ID by querystring, it functions normally!
Thank you
Paula