ASP.NET page lifecycle and In-Line code

  • Thread starter Thread starter redhair
  • Start date Start date
R

redhair

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() %>
 
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
 
Back
Top