G Guest May 9, 2007 #1 Is it possible to wire up the Page_Load event in ASP.NET 2.0 programmatically if I set my AutoWireUp=false
Is it possible to wire up the Page_Load event in ASP.NET 2.0 programmatically if I set my AutoWireUp=false
G Guest May 9, 2007 #2 Duh! A little more thought and I answered it on my own. If I have a Page directive such as the following where the AutoEventWireup="false", I'd need to hoook up my own event handlers in the constructor. <%@ Page Language="C#" Trace="false" AutoEventWireup="false" CodeFile="Default.aspx.cs" Inherits="_Default" %> So, if my codebehind class was _Default, I'd need to create a constructor for it, such as: public _Default() { this.Load += new System.EventHandler(this._Page_Load); } Thanks
Duh! A little more thought and I answered it on my own. If I have a Page directive such as the following where the AutoEventWireup="false", I'd need to hoook up my own event handlers in the constructor. <%@ Page Language="C#" Trace="false" AutoEventWireup="false" CodeFile="Default.aspx.cs" Inherits="_Default" %> So, if my codebehind class was _Default, I'd need to create a constructor for it, such as: public _Default() { this.Load += new System.EventHandler(this._Page_Load); } Thanks