c# - 无法弄清楚我做错了什么 ASP.NET C#

标签 c# asp.net checkboxlist

Server Error in '/asppub' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'ASP.mis3200_unit4_ringu4l2_2_aspx' does not contain a definition for 'cblFees_SelectedIndexChanged' and no extension method 'cblFees_SelectedIndexChanged' accepting a first argument of type 'ASP.mis3200_unit4_ringu4l2_2_aspx' could be found (are you missing a using directive or an assembly reference?)

来源错误:

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">

源文件:c:\Users\Ryan\Desktop\asppub\MIS3200\Unit4\RingU4L2.2.aspx 行:114

最佳答案

您需要在代码后面声明事件处理程序 cblFees_SelectedIndexChanged,如果您不使用它,只需从 asp:CheckBoxList 中删除 onselectedindexchanged="cblFees_SelectedIndexChanged" 标签。

通常 asp:CheckBoxList 不执行 postback 并且不需要 selectedindexchanged 事件。

关于c# - 无法弄清楚我做错了什么 ASP.NET C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21747530/

相关文章:

php - 在 php 的 javascript 中获取 Checkbox[] 值

c# - 无法在 dotnet core api : no middleware to handle the request 上调用 Controller 方法

c# - 模式匹配后在 foreach 循环中填充 List<T>

asp.net - 如何使用存储过程从 ASPNETDB 获取用户信息

php - 如何将 DOM 树转换为图像

javascript - Firefox Iframe 问题

database - 如何在struts2的复选框列表中保留值?

.net - 如何在 ASP.NET MVC 中创建 CheckBoxListFor 扩展方法?

c# - 将函数从 c# 2008 转换为 Vb6.0 错误

c# - 在不影响客户端的情况下更改 WCF 项目的命名空间