This has been confusing me for a couple of days now, can anyone offer any suggestions:
I have an ajax based page with several controls on. One of these controls is a check box list. This is populated with n number of check boxes when the page runs.
This is the code and it works OK, it is called from the page load inside a is.page postback check and only runs on the first time the page loads:
Dim x As New JobPlan
Dim NoOfWeeks As DataSet = x.WeekCycleByJobPlan(Session("JobPlan_ID"))
cblWeek.DataSource = NoOfWeeks
cblWeek.DataTextField = "Week"
cblWeek.DataValueField = "Week"
I check to see if any check boxes have been check with this serverside code
'set up a loop to check if one of the weeks has been checked
For a = 0 To cblWeek.Items.Count - 1
If cblWeek.Items(a).Selected Then
flgWeek = True
What is happening is this, and I'm looking in the page load event so its the first thing that happens - on the initial postback the flgWeek always returns false with one checked, but on the next postback there is data.
Like I said the control is set up on the initial page load, and nothing is running in code that I can see to change the checkboxlist on the firat postbackm with out data to put data in on the second postback.