Page_Load not firing

Any idea why the page load event is firing?

file test.aspx:
<%@ Page Language = "CS" Inherits="CurrencyConverter" AutoEventWireup="false" Src="main.cs" %>
<html><body>
      <div style="FONT_WEIGHT: bold" id="Result" runat="server"></div>
</body></html>

file main.cs:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public class CurrencyConverter : Page
{
      protected HtmlGenericControl Result;
      
      private void Page_Load(Object sender, EventArgs e)
      {
            if (this.IsPostBack == false)
            {
            Result.InnerText = "Done";
            }
      }
}

Trying to learn .NET C#... I assume this is an easy question?
Sheldon LivingstonConsultantAsked:
Who is Participating?
 
laotzi2000Commented:
try change
<%@ Page Language = "CS" Inherits="CurrencyConverter" AutoEventWireup="false" Src="main.cs" %>
to
<%@ Page Language = "CS" Inherits="CurrencyConverter" AutoEventWireup="true" Src="main.cs" %>
0
 
Sheldon LivingstonConsultantAuthor Commented:
Bingo!  Thanks a lot!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.