wireup Page_Load programmatically in ASP.NET 2.0

Discussion in 'ASP .Net' started by =?Utf-8?B?dGVkMTIz?=, 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
    =?Utf-8?B?dGVkMTIz?=, May 9, 2007
    #1
    1. Advertising

  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

    "ted123" wrote:

    > Is it possible to wire up the Page_Load event in ASP.NET 2.0 programmatically
    > if I set my AutoWireUp=false
    =?Utf-8?B?dGVkMTIz?=, May 9, 2007
    #2
    1. Advertising

  3. =?Utf-8?B?dGVkMTIz?=

    Mark Rae Guest

    Mark Rae, May 9, 2007
    #3
    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,154
    nfedin
    Feb 23, 2004
  2. localhost

    Dynamic Control Event Wireup?

    localhost, May 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    10,270
    Steven Cheng[MSFT]
    May 19, 2004
  3. z. f.
    Replies:
    0
    Views:
    551
    z. f.
    Oct 19, 2004
  4. =?Utf-8?B?T2RkYmFsbA==?=

    Event wireup headache

    =?Utf-8?B?T2RkYmFsbA==?=, Oct 2, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    385
    bruce barker \(sqlwork.com\)
    Oct 2, 2006
  5. רמי

    LoadControl And Events Wireup

    רמי, May 14, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    416
    sternr
    May 16, 2008
Loading...

Share This Page