Page_Load doesn't execute

  • Thread starter Thread starter jhcorey
  • Start date Start date
J

jhcorey

This has got me puzzled. I was actually working with a stylesheet when
the Page_Load function of my page stopped getting called.
I debugged, and the debugger will stop in the OnInit function, but not
in Page_Load. I copied everything from the aspx and cs files and
created a new page, and that works fine, but the old one doesn't.

So I'm not stuck, just curious if this has happened to anybody else.

Jim
 
VS.NET likes to do this to you when switching back and forth from
design view. Do a diff in source control, and see if anything has
vanished from the autogenerated portion of your codebehind. This is
what you should see there:

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new EventHandler(this.Page_Load);
}
#endregion


Hope this helps!

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top