Professional ASP.NET Server Controls Thursday, May 08 2008
While Wrox .NET books haven't been very good and there has been a lot of complaining about them on a number of mailing lists in the past few months, I would suggest to anyone who is interested in building custom ASP.NET server controls to go buy Professional ASP.NET Server Controls.
I've been reading ASPToday lately (I bought a subscription I figured I might as well use it) and there was an article on ASP.NET page templating techniques. I read it and while it did describe a valid templating technique, it was absolutely horrible. Who wants to build their ASP.NET pages purely through adding controls in the code behind class??? The main technique present in this article suggests creating a page-based templating technique that pretty much uses LiteralControls and controls you create through code. So not only is the template defined in code, so must every single one of your pages. Talk about a pain in the ass if you ask me.
So naturally I looked into creating my own templating technique (not that I need one, I just wanted to see what was so hard about it that people had to suggest horrible ideas). I spent about 2 hours reading the book (skipping parts I already knew) and found my solution. In short I have a page templating system where you define your "regions" of template areas and your "drop target" where you can add custom controls, etc to your page. I spent about 8 hours coding it last night (mixed in with some television watching and Minesweeper playing) and I finished it. Very simple if you ask me. Once I get the designer working properly in VS.NET I am going to write up an article and probably submit it to 15seconds and I'll put up a link here when it's published. If anyone wants to see how the template works before I write the article, shoot me an email and I'll send you the code and a short description.
I've been reading ASPToday lately (I bought a subscription I figured I might as well use it) and there was an article on ASP.NET page templating techniques. I read it and while it did describe a valid templating technique, it was absolutely horrible. Who wants to build their ASP.NET pages purely through adding controls in the code behind class??? The main technique present in this article suggests creating a page-based templating technique that pretty much uses LiteralControls and controls you create through code. So not only is the template defined in code, so must every single one of your pages. Talk about a pain in the ass if you ask me.
So naturally I looked into creating my own templating technique (not that I need one, I just wanted to see what was so hard about it that people had to suggest horrible ideas). I spent about 2 hours reading the book (skipping parts I already knew) and found my solution. In short I have a page templating system where you define your "regions" of template areas and your "drop target" where you can add custom controls, etc to your page. I spent about 8 hours coding it last night (mixed in with some television watching and Minesweeper playing) and I finished it. Very simple if you ask me. Once I get the designer working properly in VS.NET I am going to write up an article and probably submit it to 15seconds and I'll put up a link here when it's published. If anyone wants to see how the template works before I write the article, shoot me an email and I'll send you the code and a short description.

