我得到了错误
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>
发布于 2013-11-27 04:41:14
当我重命名了一个字段时,我收到了这个错误。由于某些原因,有时设计器搞砸了,没有在form.aspx.designer.vb文件中重命名它,如果你在那里查看并修复它的名称,如果这种情况发生在你身上,它可以解决这个问题。
因此,请仔细检查even处理程序、aspx文件和designer.aspx文件中的字段名是否相同。
发布于 2016-05-26 22:36:26
我在升级旧版页面时遇到过这个问题。问题出在Inherits attribute @Page指令的命名空间错误。
在设计器文件中更正命名空间以继承attribute
中与其匹配。
发布于 2016-03-22 22:07:50
我在按钮的OnClick事件中发生了这种情况。我最初将面板中的按钮放在网格视图列的ItemTemplate中。我只需要在其他一些按钮OnClick事件上弹出面板,所以我真的不需要在网格中重复它。不管怎么说,它被藏起来了。我把面板移到了网格视图之外,错误就消失了。
https://stackoverflow.com/questions/7674574
复制相似问题