ASPNET 3.0 newbie question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ckkwan@my-deja.com

    #1

    ASPNET 3.0 newbie question

    My VS2008 just arrive.

    One very dumb question, how to subscribe to event like Page_Init?

    I can't find it anywhere in the IDE. Ended up have to type in myself.

    TIA
  • Juan T. Llibre

    #2
    Re: ASPNET 3.0 newbie question

    If using VB, open your code-behind page in the IDE,
    select (Page Events) from the left-hand dropdown,
    and then select Init from the right-hand dropdown.

    The IDE will write this :

    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArg s) Handles Me.Init

    End Sub

    If you are coding in C#, enter the Page_Init event handler using this code :

    private void Page_Init(objec t sender, EventArgs e)

    {

    }

    The IDE won't write anything for you.



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    =============== =============== ========
    <ckkwan@my-deja.comwrote in message news:bf522e9c-ce5d-4bdf-a764-cf737099eaef@n1 g2000prb.google groups.com...
    My VS2008 just arrive.
    >
    One very dumb question, how to subscribe to event like Page_Init?
    >
    I can't find it anywhere in the IDE. Ended up have to type in myself.
    >
    TIA


    Comment

    • Madhur

      #3
      Re: ASPNET 3.0 newbie question

      Just for the information , since you are newbie.

      You might be wondering how this method definition is magically being linked
      to Page's Init event, look at the directive
      AutoEventWireUp

      --
      Madhur

      "Juan T. Llibre" <nomailreplies@ nowhere.comwrot e in message
      news:uKsWGbQtIH A.2208@TK2MSFTN GP04.phx.gbl...
      If using VB, open your code-behind page in the IDE,
      select (Page Events) from the left-hand dropdown,
      and then select Init from the right-hand dropdown.
      >
      The IDE will write this :
      >
      Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArg s)
      Handles Me.Init
      >
      End Sub
      >
      If you are coding in C#, enter the Page_Init event handler using this code
      :
      >
      private void Page_Init(objec t sender, EventArgs e)
      >
      {
      >
      }
      >
      The IDE won't write anything for you.
      >
      >
      >
      Juan T. Llibre, asp.net MVP
      asp.net faq : http://asp.net.do/faq/
      foros de asp.net, en español : http://asp.net.do/foros/
      =============== =============== ========
      <ckkwan@my-deja.comwrote in message
      news:bf522e9c-ce5d-4bdf-a764-cf737099eaef@n1 g2000prb.google groups.com...
      >My VS2008 just arrive.
      >>
      >One very dumb question, how to subscribe to event like Page_Init?
      >>
      >I can't find it anywhere in the IDE. Ended up have to type in myself.
      >>
      >TIA
      >
      >
      >

      Comment

      • sturyuu5eye@gmail.com

        #4
        Re: ASPNET 3.0 newbie question

        Precisely, I used to be able to do this in VS2003.

        But now I am not able to do it anymore in VS2008 :(

        I just received my VS2008 last week.

        On May 13, 10:36 pm, "Juan T. Llibre" <nomailrepl...@ nowhere.com>
        wrote:
        If using VB, open your code-behind page in the IDE,
        select (Page Events) from the left-hand dropdown,
        and then select Init from the right-hand dropdown.
        >
        The IDE will write this :
        >
        Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArg s)Handles Me.Init
        >
        End Sub
        >
        If you are coding in C#, enter the Page_Init event handler using this code:
        >
        private void Page_Init(objec t sender, EventArgs e)
        >
        {
        >
        }
        >
        The IDE won't write anything for you.
        >
        Juan T. Llibre, asp.net MVP
        asp.net faq :http://asp.net.do/faq/
        foros de asp.net, en español :http://asp.net.do/foros/
        =============== =============== ========
        >
        >
        >
        <ckk...@my-deja.comwrote in messagenews:bf5 22e9c-ce5d-4bdf-a764-cf737099eaef@n1 g2000prb.google groups.com...
        My VS2008 just arrive.
        >
        One very dumb question, how to subscribe to event like Page_Init?
        >
        I can't find it anywhere in the IDE. Ended up have to type in myself.
        >
        TIA- Hide quoted text -
        >
        - Show quoted text -

        Comment

        • sturyuu5eye@gmail.com

          #5
          Re: ASPNET 3.0 newbie question

          Yes, I think the AutoEventWireUp is the clue.

          And Since I jump from VS2003 to VS2008. I didn't aware something that
          had changed since 2005.

          It seems like it had been like this since VS2005. Where VB.NET can
          select the object and event for page events, but in C# we have to
          explicitly type the event handler method. :(


          On May 14, 1:29 am, "Madhur" <s...@df.comwro te:
          Just for the information , since you are newbie.
          >
          You might be wondering how this method definition is magically being linked
          to Page's Init event, look at the directive
          AutoEventWireUp
          >
          --
          Madhur
          >
          "Juan T. Llibre" <nomailrepl...@ nowhere.comwrot e in messagenews:uKs WGbQtIHA.2208@T K2MSFTNGP04.phx .gbl...

          Comment

          Working...