September 2004 - Posts

Why "I" Write Book$
29 September 04 05:01 PM | despos | 9 comment(s)

Interesting post from Wintellectual Jeff Prosise (Hi Jeff) about the reasons why we (me and Jeff at a minimum <g>) write books. Quoting the most interesting passage:

For the record, you don't write computer books for the money. You write them because a book is an education in a box. I wish I had time to type out a detailed response to every developer who contacts me needing help. Unfortunately, I can't, because the ratio of developers to me is many to 1. That's why books are so important. They allow one person--the author--to scale to meet the needs of many. God bless Gutenberg.

Speaking for myself, I do try to write books for the money, but it just doesn't work this way. However, the more people buy my books; the more I feel better and plan to do more :-)

PS #1: I've hitherto been lucky enough not to get an email like the one that Jeff mentions.

PS #2: I remember to have heard from #1 Wintellectual Jeff Richter that a fellow once arrived up to the point of asking him to lend money at the end of a few days of intense Q&A about technical topics. Yeah, I'm definitely a lucky guy :-) 

Evolution of luring emails
27 September 04 03:59 PM | despos | 4 comment(s)

As many (all?) of you, I periodically find in my inbox messages from close relatives to presidents (so to speak) of various African republics (so to speak). As usual, they claim to have access to safe deposits for several trillion dollars just waiting for our bank account details for immediate and 100% guaranteed wire transfer.

Nothing new.

Today, I noticed a little evolution. The message came in the name of the nephew of Michail Khodorkhovsky (hope to have spelled it out correctly). What's the difference? From my point of view, Khodorkhovsky is a known name that I could associate to a story and a real person.

Not that this would give more credit to the whole message; yet I smiled before I deleted it.

3 pills of wisdom
23 September 04 12:55 PM | despos | 3 comment(s)
  • 1) The problem of XML is not just that it is human-readable, but that it is also manager-readable (a reader)
  • 2) Logs help detection and prevention of Web attacks; if anybody reads them (another reader)
  • 3) COM gave us ActiveX; .NET got rid of it (my pal Nick Landry)

Other pills?

News from Denmark (read, C# 3.0)
23 September 04 09:47 AM | despos | 2 comment(s)

This week I spoke to JAOO conference in Aarhus, Denmark. It was nice to talk about ASP.NET to most people with a solid background in Java Server Pages. What I liked most of the conference was its cross sense of application development. Side by side, there were tracks on Java, J2EE, Java-based frameworks, and .NET best practices. Like all the world could speak a common intermediate (not that high-level) language.

Interesting conference. BTW, I also tried to figured out how to pronounce its name. Options available are:

1) yao (as I would have said myself, as an Italian)

2) ciao (as Ingo Rammer, German speaking, said--yep, like "Hi" in Italian)

3) yahoo (as most people say, mostly Danish)

Anders Hejlsberg was invited to give a keynote speech. He unveiled some of the ideas we'll hopefully find in C# 3.0. Nothing really new if you constantly monitor the universe of MSDN and related sources. At this time, C# 3.0 is expected to have a native integration with databases, specifically query and set language-level operators. Read (more exactly, hear) more here.

 

Bedrock for ASP.NET
23 September 04 09:33 AM | despos | 7 comment(s)

A lot of people (including my DNR pal Carl Franklin) suggested to do that a while back. It actually went online a few weeks ago. This article discusses and demonstrates inheritance in ASP.NET pages as a way to add functionality, and to make it available to all your pages. The article shows how to add page refresh handling, support for long processes, and focus control to the Page class.

DynamicPlaceholder
15 September 04 06:20 PM | despos | 3 comment(s)

Just want to give more visibility to a comment that Scott added to my previous post about dynamic controls. Basically, Scott pointed me to a Denis Bauer's custom control that acts as a placeholder for dynamically added controls. You can learn more here. Nice, really nice idea. It does more or less what I suggested to do but hiding all the nitty-gritty details.

Great job, Denis!

FW: Deprecating the SoapFormatter in 2.0
15 September 04 04:13 PM | despos | 2 comment(s)

As you can read here from Matt Tavis, Microsoft is seriously considering deprecating the SoapFormatter in .NET Framework 2.0. I have nothing against the idea and would after all consider it a sort of good riddance. What about you?

Instead, I'd like to have a way to easily format object instances to a text format for storing in databases or move through HTTP. Maybe a higher level wrapper of LosFormatter? BTW, LosFormatter is the .NET 1.x class used to create the viewstate text.

DotNetMania: A Word in Spanish
15 September 04 03:54 PM | despos | 1 comment(s)

Like the famous Elton John's song, I have my words in Spanish too that hopefully you (Spanish community) will understand. They are the words of an interview published on the latest issue of DotNetMania, a fine .NET magazine written in Spanish.

I started contributing to the magazine with an article on the impact of ADO.NET 2.0--it's evolution, not revolution. Translated--eh eh--sounds like ADO.NET 2.0 Evolucion, no Revolucion. Pretty much like in Italian.

If you happen to read the article, and enjoy it, don't believe (not even for a millisecond) that my Spanish is much better than my English or Italian :-) It's all credits that should go Marino Posadas.

NB: Looking for a chance to come to Spain soon for a "speaking" reason. Lately I had side reasons only to land to Spain--vacation or, worse, stopovers

JAOO Conference
15 September 04 11:14 AM | despos | 3 comment(s)

This weekend I'll fly to Aarhus, Denmark to give some talks at the JAOO conference. In particular, I'll have a workshop on ASP.NET control development and provide a couple of sessions on ASP.NET best practices for security and performance. Hope to have time for some geek meetings and drinks!

Danish UGs, get in touch.  

Dynamic Controls
15 September 04 11:10 AM | despos | 7 comment(s)

There are questions that periodically show up in my inbox even though they look wrapped up in different contexts and scenarios. One of these reiterated questions revolves around dynamically built controls. I addressed this topic in an aspnetPRO article and plan to drill down further into it sometime soon.

Latest encarnation of the question regards addition of dynamic controls in a DataGrid templated column. You add the control (say, a Button) and bind it to a Click event handler; next, you run the page. Apparently, it works. If you click and post back, though, any dynamically created controls may disappear and the postback event never fire. First off, why "may"? That's just part of the solution and the problem.

DataGrid-based pages often have a Page_Load like this:

void Page_Load(...) {
  if (!IsPostBack)
    LoadData();
  BindData();
}

In other words, the grid is bound to its data on EVERY postback, regardless of which control really caused the postback. No huge deal, but avoiding that definitely results in clearer and faster code. Not to mention possible interferences with other controls (especially well-written third-party rich controls).

If you don't bind the grid to its data though you just run into the aforementioned troubles with dynamic controls.

Any dynamically added control is a true part of the page when the postback is generated. Among other things, this means that any information that relates to these controls is correctly packed into the HTTP request and received by ASP.NET. Next, the ASP.NET handler in charge of the request—the ProcessRequest method of the page class—instantiates any statically declared control and configures them with viewstate information. Next, it further configures the controls with postback data overwriting viewstate information, if necessary. At this point, if the postback data references a dynamically created control ASP.NET just skips over it and temporarily copies the data in a helper collection of still-to-process postback data. At the end of the initialization step, the ASP.NET page handler fires the Page_Load event. This is a great time, and a formidable hook, for you to manually recreate any dynamically added controls that need be there to correctly process postback data.

After Page_Load returns, the ASP.NET page handler makes a second try on unprocessed postback data. It scans the helper collection to see if now the stored data can be matched to an existing control. If you effectively added any missing control in the mean time, the processing goes smooth and seamless and delivers the expected final behavior. Check the article for further details.

More Posts Next page »