Monday, April 10, 2006

ARGHHHHHHHHHHHHHHHHHHHHHHHH

When Page_Load Does / Will Not Fire!
Visual Studio At It Again :-)
So I decided I didn't have any more gunpowder in my Page_Load - it wouldn't fire!! In having problems with my default.aspx page not running the Page_Load function I found out after watching the files that Visual Studio .NET was removing my code from the InitializeCompenent() function. I am not sure why but I simply replaced:

this.Load += new System.EventHandler(this.Page_Load);

in the function and I was good to go. Of course this also can apply if a form doesn't seem to submit on your onClick code for a button isn't running (ASP.NET onClick code). If this is the case make sure it has a System.EventHandler in the InitializeComponent() function.

No comments: