I get the error
Handles clause requires a WithEvents variable defined in the containing type or one of its base types.
in the following code..
Public Sub selCurrentManuf_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles selCurrentManuf.SelectedIndexChanged
End Sub
The drop list to go with it is the following...
<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>
I've gotten this error when for some I've renamed a field. For some reason sometimes the designer messes up and doesn't rename it in the form.aspx.designer.vb file, if you look in there and fix the name it can fix this issue if that has happened to you.
So double check that the field name is the same in your even handler, the aspx file and the designer.aspx files.
I had encountered this issue when upgrading a legacy page. The problem is in the Inherits attribute @Page directive has the wrong namespace.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With