Can't figure out what I'm doing wrong ASP.NET C #

Server error in "/ asppub" application. Compilation Error Description: An error occurred while compiling the resource required to service this request. Review the following specific error data and modify the source code accordingly.

Compiler error message: CS1061: 'ASP.mis3200_unit4_ringu4l2_2_aspx' does not contain a definition for 'cblFees_SelectedIndexChanged' and there is no extension method 'cblFees_SelectedIndexChanged' accepting the first one you can find an argument like 'ASP.mis3200_unit4_pu

Source Error:

Line 112:    </p>
Line 113:    <p>
Line 114:        <asp:CheckBoxList ID="cblFees" runat="server" 
Line 115:            onselectedindexchanged="cblFees_SelectedIndexChanged" RepeatLayout="Flow" 
Line 116:            ValidationGroup="L2.2">

Source file: c: \ Users \ Ryan \ Desktop \ asppub \ MIS3200 \ Unit4 \ RingU4L2.2.aspx Line: 114

+4
source share
3 answers

You need to declare an event handler cblFees_SelectedIndexChangedin the code behind if you are not using its simple removal onselectedindexchanged="cblFees_SelectedIndexChanged"from the tag asp:CheckBoxList.

Usually asp:CheckBoxListdoes not execute postbackand does not require an event selectedindexchanged.

0
source

A compilation error because the compiler is trying to figure out the event handler or method, namely cblFees_SelectedIndexChanged. It looks like you haven't added this to your aspx.cs class. If you are not using it, remove it from the code, otherwise define a handler for it.

0
source

cblFees_SelectedIndexChanged , . OnSelectedIndexChanged Ctrl_Spce . . New event . . enter image description here

0
source

Source: https://habr.com/ru/post/1526689/


All Articles