How to fix Event 'Load' cannot be found error?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marknut
    New Member
    • Apr 2010
    • 42

    How to fix Event 'Load' cannot be found error?

    I have a form that can't use Page Events for some reason. I had to rename the class because the form was duplcated a while back.

    .ASPX: <%@ Page Language="vb" AutoEventWireup ="false" CodeBehind="New _Hire.aspx.vb" Inherits="SIM.Webform_New _Hire" %>

    .ASPX.VB: Partial Public Class Webform_New_Hir e

    .ASPX.DESIGNER. VB: Partial Public Class Webform_New_Hir e

    I would think that is setup correctly but I must need to update another file or something. Any ideas?
  • aspdotnetuser
    New Member
    • Nov 2010
    • 22

    #2
    1. Delete the events.
    2. At the top of the page in visual studio, you have two dropdowns one for controls other for events.Choose the control and choose the event. it creates the code for the event.
    3. Now your compilation/runtime error vanishes.

    Comment

    • Pulsarcoder
      New Member
      • Sep 2016
      • 1

      #3
      No, you need a Inherits declaration into the class definition.
      This would look like this.

      Code:
      Public Class AlertHandler
          Inherits System.Web.UI.Page
      
          Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
      
          End Sub
      End Class
      Regards, René Funk

      Comment

      Working...