加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 04:30:32 所属栏目:asp.Net 来源:网络整理
导读:我收到了错误 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 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>

解决方法

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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读