Results 1 to 2 of 2
  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2010

    WithEvents variable defining base types to Default.aspx.vb


    <asp:Button ID="Button2" runat="server" Text="Beach City" width="110%" />


    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
    End Sub

    Error code:

    Error BC30506 Handles clause requires a WithEvents variable defined in the containing type or one of its base types.

    How do I add a WithEvents variable defining base types to Default.aspx.vb?

  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Sydney, Australia

    Re: WithEvents variable defining base types to Default.aspx.vb

    Did you just add that tag to the ASPX file or did you add a Button control in the designer? If you did the latter then it should have added that variable automatically. If that didn't happen, try deleting the Button in the designer and try again.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.