Click to See Complete Forum and Search --> : [RESOLVED] Page_Load Question (VB)


stin
March 14th, 2007, 11:36 AM
For some reason my Page_Load seems to not be executing.

I'm using Visual Web Developer Express for this test project.

I've search the forum a bit and found some solutions for C#, but nothing for VB.

Here is my code

<script runat="server">
Sub Page_Load()
lbl1.Text = "The date and time is " & Now()
End Sub
</script>

<html>
<body>
<form id="Form1" runat="server">
<h3><asp:label id="lbl1" runat="server" /></h3>
</form>
</body>
</html>


The label doesn't appear at all.

Anyone have any suggestions?

Thanks

stin
March 14th, 2007, 11:39 AM
Ok:

I changed AutoEventWireup to True and the problem went away.

<%@ Page Language="VB" AutoEventWireup="True" CodeFile="Default.aspx.vb" Inherits="_Default" %>