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

前端之家收集整理的这篇文章主要介绍了asp.net – Handles子句需要在包含类型或其基类型之一中定义的WithEvents变量前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我收到了错误
  1. Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

在以下代码中..

  1. Public Sub selCurrentManuf_SelectedIndexChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) _
  2. Handles selCurrentManuf.SelectedIndexChanged
  3.  
  4. End Sub

随附的下拉列表如下……

  1. <asp:DropDownList
  2. OnSelectedIndexChanged="selCurrentManuf_SelectedIndexChanged"
  3. selectedvalue='<%#Container.DataItem("c1_manufidcurrent")%>'
  4. ID="selCurrentManuf"
  5. Runat="Server"
  6. DataTextField="c4_Desc"
  7. DataValueField="c4_manufid"
  8. DataSource="<%# GetCurrentManuf() %>"
  9. autopostback="true"
  10. ></asp:DropDownList>

解决方法

升级页面时遇到此问题.问题在于Inherits属性@Page指令有错误的命名空间.

>更正Inherits属性名称空间>删除设计器文件中的命名空间或在设计器代码中与其匹配

猜你在找的asp.Net相关文章