ASP.NET page lifecycle and In-Line code

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() %>
 
S

Scott Allen

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
 
Joined
Apr 14, 2012
Messages
1
Reaction score
0

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top