ASP.NET page lifecycle and In-Line code

Discussion in 'ASP .Net' started by redhair, Nov 30, 2004.

  1. redhair

    redhair Guest

    In a asp.net page (.aspx) below, I'd like to know the in-line code
    ("<%Output()%> ) will be executed
    in which page process lifecycle? thanks.



    <Script Language="VB" Runat="Server">
    Sub Output()
    ........
    End Sub
    </Script>

    <form runat=server>
    <Asp:ListBox runat=Server ID=user_department rows=1>
    </Asp:ListBox>
    </form>
    <% Output() %>
    redhair, Nov 30, 2004
    #1
    1. Advertising

  2. redhair

    Scott Allen Guest

    When the WebForm renders.

    You can see this if you find the .vb file the ASP.NET runtime
    generates from the ASPX page. It will be in the Temporary ASP.NET
    Files directory where the framework is installed and the relavant part
    would look something like:

    Public Class temp_aspx
    ...

    Sub Output()
    Response.Write("Foo")
    End Sub

    ...


    Private Sub __Render__control1( _
    ByVal __output As HtmlTextWriter, _
    ByVal parameterContainer As Control)

    parameterContainer.Controls(0).RenderControl(__output)

    Output()

    End Sub

    ...

    End Class

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Tue, 30 Nov 2004 16:54:00 +0800, "redhair" <> wrote:

    >In a asp.net page (.aspx) below, I'd like to know the in-line code
    >("<%Output()%> ) will be executed
    >in which page process lifecycle? thanks.
    >
    >
    >
    ><Script Language="VB" Runat="Server">
    >Sub Output()
    > ........
    >End Sub
    ></Script>
    >
    ><form runat=server>
    ><Asp:ListBox runat=Server ID=user_department rows=1>
    ></Asp:ListBox>
    ></form>
    ><% Output() %>
    >


    --
    Scott
    http://www.OdeToCode.com/
    Scott Allen, Nov 30, 2004
    #2
    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. Epson Barnett
    Replies:
    1
    Views:
    318
    Epson Barnett
    Apr 21, 2004
  2. John Lau

    Page and control lifecycle

    John Lau, May 11, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    509
    John Lau
    May 11, 2004
  3. Replies:
    0
    Views:
    326
  4. Replies:
    5
    Views:
    363
  5. Hans Kesting

    Page lifecycle and dynamic controls

    Hans Kesting, Nov 3, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    466
    Mike Gleason jr Couturier
    Nov 3, 2008
Loading...

Share This Page