Adding Event to C# VS 2003

Discussion in 'ASP .Net' started by tshad, Nov 2, 2007.

  1. tshad

    tshad Guest

    I normally use DW to create my pages and never have to worry about events.
    They are just created.

    In DW, all my code and design are on one page (no code-behind).

    When I create a Page_PreRender event - it just works.

    Sub Page_PreRender(ByVal Sender As Object, ByVal E As EventArgs)
    ....
    End Sub

    But in VS 2003 if I add the following lines

    private void Page_PreRender(object sender, EventArgs e)
    {
    }

    It doesn't generate the event.

    I have to then go over to InitializeComponent Event and add the following
    line:

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

    Why is this?

    I don't have to add a special handler in DW.

    Is there an easier way to add an event like this?

    Thanks,

    Tom
    tshad, Nov 2, 2007
    #1
    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. Bootstrap Bill

    Visual Studio .net 2003 and Frotpage 2003

    Bootstrap Bill, Sep 12, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    585
    Bootstrap Bill
    Sep 17, 2004
  2. Hawkmoth
    Replies:
    4
    Views:
    933
    =?Utf-8?B?SGF3a21vdGg=?=
    Mar 30, 2005
  3. David Waz...
    Replies:
    5
    Views:
    414
    Yan-Hong Huang[MSFT]
    Jul 14, 2003
  4. Kieran Kelly
    Replies:
    3
    Views:
    831
    Shaji
    Sep 29, 2003
  5. JollyK
    Replies:
    0
    Views:
    528
    JollyK
    Feb 9, 2004
Loading...

Share This Page