Any reason why Page_Load would be ignored?

J

Jim Bancroft

Inexplicably one of my aspx pages is ignoring the Page_Load handler. The
page worked fine this morning, but then I added a couple of "using"
directives and uncommented a method call about halfway down, and suddenly I
can't get Page_Load to run no matter what.

I've rebuilt the web project several times but nothing doing. VS .Net
debugger doesn't even stop on my breakpoints in the function, though it has
no problem on other, button-click, event handlers.

Has anyone seen this before, and even better, is there a checklist I run
through to diagnose it? I swear my changes were minor at best. I must have
missed _something_....
 
C

Curt_C [MVP]

is this still in the Initialize seciton:
this.Load += new System.EventHandler(this.Page_Load);
 
F

Fabio

Jim said:
Has anyone seen this before, and even better, is there a checklist I run
through to diagnose it? I swear my changes were minor at best. I must have
missed _something_....

Hey Jim,
I had seen something similar in the past: the solution was to manually delete
the dll and rebuild the solution - somehow rebuilding was not entirely
overwriting the dll, but physically deleting it from the disk and forcing a
fresh build worked...

HTH
 
J

Juan T. Llibre

I'd start by removing the "using" directives
and recommenting the method call.

Then. I'd work my way up again,
until the behavior begins again.

Undoing what you did sometimes works wonders :)


Juan T. Llibre
ASP.NET MVP
===========
 
J

Jim Bancroft

Hi Curt; I do have the system event handler code as you mentioned in my
page, in the InitializeComponent function.

Fabio, I deleted all the dlls from my web application's bin directory,
rebuilt it, and still the same problem. Is that the location you were
referring to, or should I be looking elsewhere? Just for kicks I removed
all the aspx and code-behind content and recompiled with a blank page,
saved, reloaded the page my browser to see if it took effect (it did),
closed VS .Net, repasted all the code and it's back to square one. Same
problem.

And Juan, I'm removing using directives and recommenting now, trying to find
the right mix that will work.

Thanks again guys. It sounds like there's just something strange that I
_must_ be missing. Some days I miss dos 5.0, you know?
 
J

Jim Bancroft

Turns out I had accidentally deleted the OnInit function in my haste to
un-delete my original method call:


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


Whoops....don't I have egg on my face. Thanks again, everyone, and sorry
for the trouble.

-Jim
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top