lorena Posted June 7, 2005 Posted June 7, 2005 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 Quote
kahlua001 Posted June 7, 2005 Posted June 7, 2005 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. Quote
lorena Posted June 7, 2005 Author Posted June 7, 2005 Are you saying if I handle an event in the code behind I don't need to reference it or call it from the front (aspx) page? Quote
lorena Posted June 8, 2005 Author Posted June 8, 2005 Sorry - I understand now. I fixed the code and it works. Thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.