wireup Page_Load programmatically in ASP.NET 2.0

G

Guest

Is it possible to wire up the Page_Load event in ASP.NET 2.0 programmatically
if I set my AutoWireUp=false
 
G

Guest

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
 

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,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top