dcsimg
Results 1 to 2 of 2

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

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2010
    Posts
    85

    WithEvents variable defining base types to Default.aspx.vb

    Default.aspx

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

    Default.aspx.vb

    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
    Response.Redirect("~/Canton.aspx")
    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
    Location
    Sydney, Australia
    Posts
    100,634

    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
  •  



Featured


Click Here to Expand Forum to Full Width