Victor Garcia Aprea : New LoadFinished event for Page

Subscriptions

<March 2010>
SuMoTuWeThFrSa
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Post Categories




New LoadFinished event for Page

Lots of people starting to learn ASP.NET tend to heavily depend on the Load event. They find quite naturally to write most core logic into Load until they realize their code just doesn’t work as expected and start coding all kind of hacks.

 

A common example of this mistake is to write code in Load that depends on values that will be updated only after postback data has been processed; but as Load fires before postback data (2nd try) and RaiseChangedEvents and RaisePostBackEvent are processed such code won’t work properly -- and that is when people start writing hacks like peeking at the Forms collection to get the updated value; the WebForm model is not followed and bad things happen when you do that J

 

If you still doesn’t get the scenario I’m talking about take a look at this post.

 

The solution to this? Move your code to PreRender, sure; but this doesn’t sound very intuitive to a beginner.

 

I believe that adding a brand new event to Page, something like LoadFinished that fires right after 2nd try postback data and changed & postback events are processed and right before PreRender would be a more natural choice where to put such code.

 

You could then market this new event as the one that fires when the page has completely finished its loading and the place where any code can safely depend on all postback data to be updated.

 

 

posted on Sunday, May 25, 2003 3:11 AM by vga

# re: New LoadFinished event for Page @ Wednesday, October 11, 2006 7:53 PM

<a href="http://mlmleads.blogshot.nl">http://mlmleads.blogshot.nl ">Lead</a>
<a href="http://leadmlm.blogshot.nl">http://leadmlm.blogshot.nl ">MLM</a>
http://mlmleads.blogshot.nl">http://mlmleads.blogshot.nl
http://leadmlm.blogshot.nl">http://leadmlm.blogshot.nl

MLM

# toyota corolla body kit @ Wednesday, May 30, 2007 10:35 PM

<a href=http://loganbonnethau220.150m.com/16.html">http://loganbonnethau220.150m.com/16.html>toyota">http://loganbonnethau220.150m.com/16.html">http://loganbonnethau220.150m.com/16.html>toyota corolla body kit</a> :: [url=http://loganbonnethau220.150m.com/16.html">http://loganbonnethau220.150m.com/16.html]toyota corolla body kit[/url] :: http://loganbonnethau220.150m.com/16.html">http://loganbonnethau220.150m.com/16.html toyota corolla body kit ::

toyota corolla body kit

# re: New LoadFinished event for Page @ Saturday, January 17, 2009 1:30 PM

zeBKwX <a href="http://kzsqtiomojkx.com/">kzsqtiomojkx</a>, [url=http://zwmqdvkjynmg.com/]zwmqdvkjynmg[/url], [link=http://sjmaqvbxdqse.com/]sjmaqvbxdqse[/link], http://nrcjrlsvwhsh.com/

tfjqmwjc

# re: New LoadFinished event for Page @ Sunday, March 22, 2009 11:29 AM

P47wdC <a href="http://vnnjseibkzwl.com/">vnnjseibkzwl</a>, [url=http://theotnsapopb.com/]theotnsapopb[/url], [link=http://mfwdustdrdla.com/]mfwdustdrdla[/link], http://jiscxwtiqigj.com/

yhhbkb

# re: New LoadFinished event for Page @ Sunday, March 22, 2009 1:50 PM

8vRNyB <a href="http://jrywgggikubm.com/">jrywgggikubm</a>, [url=http://ajwophbhvyyq.com/]ajwophbhvyyq[/url], [link=http://ooayhyfeqvuv.com/]ooayhyfeqvuv[/link], http://vdzjvwnubzse.com/

ybdpmtdcl

# re: New LoadFinished event for Page @ Sunday, March 22, 2009 3:02 PM

wyPYdW <a href="http://lfjagyxuywvj.com/">lfjagyxuywvj</a>, [url=http://rgobepvisfqr.com/]rgobepvisfqr[/url], [link=http://giugwipcjcaw.com/]giugwipcjcaw[/link], http://gbrwulynbooj.com/

azksaldqjh

# re: New LoadFinished event for Page @ Tuesday, June 02, 2009 6:49 AM

fsj42M <a href="http://gjflgwopkmsz.com/">gjflgwopkmsz</a>, [url=http://eucsendeyuaq.com/]eucsendeyuaq[/url], [link=http://kssxypbdhbjm.com/]kssxypbdhbjm[/link], http://dzvvdonntvwu.com/

yluxvrphgzo

# cheap cialis @ Tuesday, September 22, 2009 2:54 PM

Hello!
<a href="http://apxyieo.com/qyoxay/1.html">cheap cialis</a> ,

cialis

# cialis @ Saturday, September 26, 2009 5:55 PM

Hello!
<a href="http://opeyixa.com/rvqavqx/1.html">cialis</a> ,

cialis

# buy cialis @ Monday, October 05, 2009 8:32 PM

Hello!
<a href="http://oixapey.com/aqavrr/1.html">buy cialis</a> ,

cialis

# buy cialis @ Tuesday, October 20, 2009 8:48 AM

Hello!
<a href="http://aixopey.com/qqavxt/1.html">buy cialis</a> ,

cialis

# cialis @ Wednesday, November 04, 2009 2:54 PM

Hello!
<a href="http://oixapey.com/aqavvr/1.html">cialis</a> ,

cialis

# buy cialis @ Tuesday, December 08, 2009 9:17 PM

Hello!
<a href="http://aixypeo.com/ayrxsa/1.html">buy cialis</a> ,

cialis

# wflpBm @ Friday, January 08, 2010 9:14 PM

Hi! MMUSNcX

wflpBm

# cialis @ Sunday, January 31, 2010 5:13 AM

Hello!
<a href="http://apxoiey.com/qoxvrt/1.html">cialis</a> ,

cialis

# re: New LoadFinished event for Page @ Sunday, February 21, 2010 5:55 PM

xpMsZM <a href="http://ligcjuuhmvnu.com/">ligcjuuhmvnu</a>, [url=http://oufeohdjoifm.com/]oufeohdjoifm[/url], [link=http://xujxuwbnsxni.com/]xujxuwbnsxni[/link], http://eibtkobrptum.com/

ztezuyem

# cialis @ Wednesday, February 24, 2010 12:06 PM

Hello!
<a href="http://yieapxo.com/qroxvvq/1.html">cialis</a> ,

cialis

# cialis @ Sunday, March 07, 2010 9:13 PM

Hello!
<a href="http://oixapey.com/aqastr/1.html">cialis</a> ,

cialis