Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > asp.net 1.1 page and controls life-cycle

Reply
Thread Tools

asp.net 1.1 page and controls life-cycle

 
 
Fred
Guest
Posts: n/a
 
      01-20-2006
hi, i have a page written by someone else w/ a few user controls inside
it(w/ user controls inside em too) - what i dont get is the order
different page_inits, page_loads, cashed and postback events and code
inside <% %> are executing

can u plz point me to a specification or some other description of the
whole process

TIA
 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      01-20-2006
http://aspalliance.com/articleViewer.aspx?aId=134&pId=

init
load viewstate (if postback)
Process posted data (if postback)
Page Load
Process posted data again (if postback, necessary incase things changed in
page_load)
Raise events (if postback)
Prerender
Save viewstate
Unload

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Fred" <> wrote in message
news:...
> hi, i have a page written by someone else w/ a few user controls inside
> it(w/ user controls inside em too) - what i dont get is the order
> different page_inits, page_loads, cashed and postback events and code
> inside <% %> are executing
>
> can u plz point me to a specification or some other description of the
> whole process
>
> TIA



 
Reply With Quote
 
 
 
 
Fred
Guest
Posts: n/a
 
      01-20-2006
tnx for this info, Karl

but what happens when u have controls inside page, when are their events
processed, code inside .aspx pages and <%= %> tag, dynamicly added controls

Karl Seguin [MVP] wrote:
> http://aspalliance.com/articleViewer.aspx?aId=134&pId=
>
> init
> load viewstate (if postback)
> Process posted data (if postback)
> Page Load
> Process posted data again (if postback, necessary incase things changed in
> page_load)
> Raise events (if postback)
> Prerender
> Save viewstate
> Unload
>
> Karl
>

 
Reply With Quote
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      01-20-2006
Events are recursive. If Page_Load fires in the page, then in the child
control, then in controls within the control.

<%= %> happens sometime after prerender

dynamically added controls play catch up when they are added to the page. If
they are added in Init, then init will fire. if they are added during
page_load, then init and page_load will fire...


Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/


"Fred" <> wrote in message
news:...
> tnx for this info, Karl
>
> but what happens when u have controls inside page, when are their events
> processed, code inside .aspx pages and <%= %> tag, dynamicly added
> controls
>
> Karl Seguin [MVP] wrote:
>> http://aspalliance.com/articleViewer.aspx?aId=134&pId=
>>
>> init
>> load viewstate (if postback)
>> Process posted data (if postback)
>> Page Load
>> Process posted data again (if postback, necessary incase things changed
>> in page_load)
>> Raise events (if postback)
>> Prerender
>> Save viewstate
>> Unload
>>
>> Karl
>>



 
Reply With Quote
 
Fred
Guest
Posts: n/a
 
      01-20-2006
great, IMHO you should write an article w/ this information

one last detail when are 'script runat=server' blocks in .aspx pages
executed - again after PreRender ?

Karl Seguin [MVP] wrote:
> Events are recursive. If Page_Load fires in the page, then in the child
> control, then in controls within the control.
>
> <%= %> happens sometime after prerender
>
> dynamically added controls play catch up when they are added to the page. If
> they are added in Init, then init will fire. if they are added during
> page_load, then init and page_load will fire...
>
>
> Karl

 
Reply With Quote
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      01-23-2006
Well, if I recall, you can't just do:

<script runat="server">
Response.Write("aa");
</script>

ur runat="server" needs to have hooks into the actual methods. so the
<script runat="server"> Page_Load</script> is the same event as the
codebehind one.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Fred" <> wrote in message
news:...
> great, IMHO you should write an article w/ this information
>
> one last detail when are 'script runat=server' blocks in .aspx pages
> executed - again after PreRender ?
>
> Karl Seguin [MVP] wrote:
>> Events are recursive. If Page_Load fires in the page, then in the child
>> control, then in controls within the control.
>>
>> <%= %> happens sometime after prerender
>>
>> dynamically added controls play catch up when they are added to the page.
>> If they are added in Init, then init will fire. if they are added during
>> page_load, then init and page_load will fire...
>>
>>
>> Karl



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controls.Count, Controls.IsSynchronized, and Controls.SyncRoot Nathan Sokalski ASP .Net 4 09-05-2007 03:27 AM
Page.Controls - controls are missing? Frank Esser ASP .Net 11 04-07-2005 10:21 PM
Embedding Windows/smart client controls in a Web Controls page Martin Eyles ASP .Net 2 02-21-2005 05:09 PM
Adding controls to Page.Controls collection Jeremy Ames ASP .Net 5 03-05-2004 08:33 PM
Page.Controls to identify server controls KK ASP .Net 2 01-25-2004 02:09 PM



Advertisments