Protected Sub drp_usertype_SelectedIndexChanged(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles drp_usertype.SelectedIndexChanged
End Sub
getting error under drp_usertype.SelectedINdexChanged
Its a dropdownlist
When you declare the drp_usertype
object it must be done as :
Private WithEvents drp_usertype As DropDownList
This is the same for
Private WithEvents drp_usertype As New DropDownList
etc...
The WithEvents
keyword allows the control to hook up events, using the Handles
syntax, with its owner. When adding components in the designer it automatically generates this for you but when creating them yourself you must include the WithEvents
if you intend to use events with the component.
If you do not declare an object WithEvents
then handlers must be assigned programmatically as they are in C# using AddHandler
-- see : AddHandler
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