View Single Post
  #1 (permalink)  
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.

Code:

<%@ 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
</Script>

<html>
<head><title></title></head>
<body>

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

</body>
</html>

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