|
 |
aspx_beginners thread: checkboxlist events will NOT fire!!!
Message #1 by "Steele, Toby" <Toby.Steele@t...> on Wed, 6 Nov 2002 17:27:51 -0600
|
|
Hi all I am not able to get my code to fire the onLoad event (or any event)
for this control.
I am trying to make my checkboxes selected in a sub routine, but can never
jump into it.
I have tried every event available for this control, and none of them jump
into the Check_OnLoad routine.
Does anyone have any idea why it is behaving this way? Am I missing
something?
If anyone can give me any hint, it would make my day
Here is my snippet of code:
Dim cmdCategories As New System.Data.SqlClient.SqlCommand("cp_Categories",
m_con)
chkCategories.DataSource = cmdCategories.ExecuteReader
chkCategories.DataBind()
m_con.Close()
Sub Check_OnLoad(ByVal sender As Object, ByVal e As System.EventArgs)
Dim i, myIndex As Integer
'loop through each checkbox and search the array to see if it's value
is in the array
For i = 0 To chkCategories.Items.Count - 1
myIndex = Array.BinarySearch(m_aryCategories,
chkCategories.Items(i).Value)
If myIndex > 0 Then chkCategories.Items(i).Selected = True
Next
End Sub
toby steele
Message #2 by "toby steele" <toby.steele@t...> on Wed, 6 Nov 2002 23:58:40
|
|
OK, it IS actually firing, I just didn't know it becuase I couldn't step
into it. I set a break point in the sub and it jumped in it.
Does anyone know why it took a break point to jump into that procedure???
apologies for my posting, I am a beginner.
> Hi all I am not able to get my code to fire the onLoad event (or any
event)
for this control.
I am trying to make my checkboxes selected in a sub routine, but can never
jump into it.
I have tried every event available for this control, and none of them jump
into the Check_OnLoad routine.
Does anyone have any idea why it is behaving this way? Am I missing
something?
If anyone can give me any hint, it would make my day
Here is my snippet of code:
Dim cmdCategories As New System.Data.SqlClient.SqlCommand("cp_Categories",
m_con)
chkCategories.DataSource = cmdCategories.ExecuteReader
chkCategories.DataBind()
m_con.Close()
Sub Check_OnLoad(ByVal sender As Object, ByVal e As System.EventArgs)
Dim i, myIndex As Integer
'loop through each checkbox and search the array to see if it's value
is in the array
For i = 0 To chkCategories.Items.Count - 1
myIndex = Array.BinarySearch(m_aryCategories,
chkCategories.Items(i).Value)
If myIndex > 0 Then chkCategories.Items(i).Selected = True
Next
End Sub
toby steele
|
|
 |