gpt4 book ai didi

asp.net - 句柄子句需要在包含类型或其基类型之一中定义的 WithEvents 变量

转载 作者:行者123 更新时间:2023-12-04 02:13:29 26 4
gpt4 key购买 nike

我收到错误

Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

在下面的代码中..
Public Sub selCurrentManuf_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles selCurrentManuf.SelectedIndexChanged

End Sub

与之配套的下拉列表如下...
<asp:DropDownList  
OnSelectedIndexChanged="selCurrentManuf_SelectedIndexChanged"
selectedvalue='<%#Container.DataItem("c1_manufidcurrent")%>'
ID="selCurrentManuf"
Runat="Server"
DataTextField="c4_Desc"
DataValueField="c4_manufid"
DataSource="<%# GetCurrentManuf() %>"
autopostback="true"
></asp:DropDownList>

最佳答案

当我重命名一个字段时,我收到了这个错误。出于某种原因,有时设计器会搞砸并且不会在 form.aspx.designer.vb 文件中重命名它,如果您查看那里并修复名称,它可以解决这个问题,如果这发生在您身上。

因此,请仔细检查您的偶数处理程序、aspx 文件和designer.aspx 文件中的字段名称是否相同。

关于asp.net - 句柄子句需要在包含类型或其基类型之一中定义的 WithEvents 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7674574/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com