Victor Garcia Aprea : Sunday, May 25, 2003 - Posts

Subscriptions

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Post Categories




Sunday, May 25, 2003 - Posts

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 Sunday, May 25, 2003 3:11 AM by vga with 2 Comments

WebMatrix is beating VS.NET...

I just come across this screenshot of the next drop for WebMatrix in NikhilKo’s blog.

 

WebMatrix is now supporting one *very* requested wish of VS.NET users… better design-time support for Web User Controls. Yes… instead of getting that little ugly-and-awkward gray box you now get WYSIWYG.

 

Sincerely, I’ve never considered WebMatrix very seriously. I’ve often referred to it as a toy or as a “kind-of-FrontPage”; (I mean, who can live without intellisense? J) but it seems like the next drop will make me change my mind, at least a bit.

 

I’m asking myself: “When will we, VS.NET users, get decent design-time support for UC?”

 

Me: “Whidbey?”

 

Me again: “Surely. But that seems *so* far away.”

 

Moreover, that question leads me to another one:

 

“What cool new feature -not implemented by VS.NET- will be WebMatrix implementing at the time VS.NET catches up with UC?”

 

posted Sunday, May 25, 2003 1:59 AM by vga with 0 Comments