• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

Page_Load not getting called

Ok, this has got to be something dumb....but i can't get the Page_Load to be called, even on something as simple as:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="vbscript" runat="server">
    Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
        lbl.Text = "hey you..."
    End Sub
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <form id="form1" runat="server">
        <asp:Label ID="lbl" runat="server" />

What's going on here...i thought page_load was always called??


1 Solution
just add handles mybase.load, this wires up the event to the function:

    Sub Page_Load(ByVal s As Object, ByVal e As EventArgs) handles mybase.load
        lbl.Text = "hey you..."
    End Sub
mattfairwAuthor Commented:
ah, right.  been a while since i've done asp.net and i knew it had to be somethin easy.  Thanks for the quick help - it worked great!

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now