Any reason why Page_Load would be ignored?

Discussion in 'ASP .Net' started by Jim Bancroft, Jan 27, 2005.

  1. Jim Bancroft

    Jim Bancroft Guest

    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_....
     
    Jim Bancroft, Jan 27, 2005
    #1
    1. Advertising

  2. Jim Bancroft

    Curt_C [MVP] Guest

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




    --
    Curt Christianson
    Site & Scripts: http://www.Darkfalz.com
    Blog: http://blog.Darkfalz.com


    "Jim Bancroft" <> wrote in message
    news:...
    >
    > 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_....
    >
     
    Curt_C [MVP], Jan 27, 2005
    #2
    1. Advertising

  3. Jim Bancroft

    Fabio Guest

    Jim Bancroft wrote:
    > 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

    --
    Software is like sex: it's better when it's free -- [Linus Torvalds]

    Fabio Marini - A+, RHCT, MCDBA, MCAD.NET
    To reply: news [at] mamakin1976 [dot] plus [dot] com
     
    Fabio, Jan 27, 2005
    #3
  4. 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
    ===========
    "Jim Bancroft" <> wrote in message
    news:...
    >
    > 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_....
    >
     
    Juan T. Llibre, Jan 27, 2005
    #4
  5. Jim Bancroft

    Jim Bancroft Guest

    Thanks, guys....

    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?
     
    Jim Bancroft, Jan 27, 2005
    #5
  6. Jim Bancroft

    Jim Bancroft Guest

    Figured it out....*blush*

    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
     
    Jim Bancroft, Jan 28, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bminder
    Replies:
    1
    Views:
    2,188
    nfedin
    Feb 23, 2004
  2. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,078
    Smokey Grindel
    Dec 2, 2006
  3. NorbertH

    page_load is ignored / asp.net 2.0

    NorbertH, Feb 2, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    403
    NorbertH
    Feb 4, 2007
  4. Milsnips
    Replies:
    4
    Views:
    413
    Juan T. Llibre
    Apr 3, 2007
  5. Sara
    Replies:
    0
    Views:
    105
Loading...

Share This Page