View Single Post
Old July 28th, 2004, 08:50 AM
New2ASPnet New2ASPnet is offline
Registered User
Join Date: Jul 2004
Location: LaFox, IL, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Page_Load not working!

This is just the dumbest question with probably a very simple answer. I am teaching myself ASP.Net from a book and the code examples all work except for when they use a Page_Load subroutine. Then nothing executes within this routine. Now this doesn't make any sense to me because it has to execute a page load even if the page loads, right? So why isn't it executing this very simple subroutine (see below)? Any insights? suggestions? I am stumped and don't know enough about ASP.NET to debug anything yet.


<%@ Page CodeBehind="CodeRender.aspx.vb" Language="vb" AutoEventWireup="false" Inherits="LearningSite.CodeRender" %>
<Script Runat="Server">
  Dim strSomeText As String
  Sub Page_Load
    strSomeText = "Hello!"
  End Sub


<form Runat="Server">
<p>The value of strSomeText is: <%=strSomeText%></p>
<% strSomeText = "Goodbye!" %>
<P>The value of strSomeText is: <%=strSomeText%></p>


Simple, huh? Ugh. Microsoft. I'm sure it's their fault somehow.