Page_Load not getting called

Posted on 2006-05-15
Last Modified: 2008-01-09
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" "">
<script language="vbscript" runat="server">
    Sub Page_Load(ByVal s As Object, ByVal e As EventArgs)
        lbl.Text = "hey you..."
    End Sub
<html xmlns="" >
<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??


Question by:mattfairw
    LVL 15

    Accepted 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
    LVL 3

    Author Comment

    ah, right.  been a while since i've done and i knew it had to be somethin easy.  Thanks for the quick help - it worked great!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now