CheckboxList Error Message

lorena

Centurion
Joined
Oct 23, 2003
Messages
134
Location
Phoenix, Arizona
I have been working on an aspx page in local mode and it works fine on my p.c. but when I copy the pages out to the web server, I get an error. The code counts the number of items selected in a checkboxlist and writes the number as an integer to a textbox.
Here is the error I get:
"BC30456: 'SystemApp_OnSelectedIndexChanged' is not a member of 'ASP.p_supp_aspx'"

Here is the code associated with the checkbox list:
(From the aspx page - there are 4 checkboxes associated with this list)
<asp:checkboxlist id="SystemApp" Runat="server" AutoPostBack="True" RepeatColumns="4" RepeatDirection="Horizontal" OnSelectedIndexChanged="SystemApp_OnSelectedIndexChanged">

(From the code behind page)
Sub SystemApp_OnSelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _
SystemApp.SelectedIndexChanged
Dim itmApp As ListItem
ViewState("TotApp") = 0
For Each itmApp In SystemApp.Items
If itmApp.Selected = True Then
ViewState("TotApp") += 1
End If
Next
TotSysApp.Text = ViewState("TotApp") + ViewState("TotOthApp")
End Sub
 
If you are calling it from your front end page, then you need to mark the sub as Public, but since you are handling this event in your codebehind, then no need to put it in your front end page.
 
Back
Top