Selected index reset on postback

JAS

Newcomer
Joined
Jan 10, 2006
Messages
1
I have a problem with controls on a webform not storing the selected index after a postback.

The controls are databound only once ( in createMenu() ) as I use

Visual Basic:
  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Not IsPostBack Then
            CreateMenu()
            InitialiseDates()
            panelParams.Visible = False
        End If
    End Sub

The postback is initiated by a click on a button
Visual Basic:
Private Sub cmdGenerateReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGenerateReport.Click
        LoadReport()
        DateSelect()
    End Sub

Neither Loadreport() or DateSelect() call a databind

The View state for the controls is on

it does not seem to matter what list control I use (dropdownlist, radiobuttonlist etc) but the selected index is always reset to 0 after the postback

I have seen lots of examples of the same problem in forums and on the web but no one seems to have posted an answer that I can get to work.

Can you help?

Thanks

JAS
 
Back
Top