Archives / 2004 / September
  • ASP.NET HowTo: including default text in a Textbox while enforcing server-side validation

    I was asked recently to develop a process wherein a server-side TextBox control could have some default text included in it, which seems to be more and more the reliable UI model for ensuring people fill out required form fields.  The kicker is that the app in which it runs still needs to enforce server-side validation, meaning that the TextBox would need input data other than the said default value, and not have the default text erroneously have the form be seen as valid.


  • Book review: "Beginning ASP.NET 1.1 E-Commerce - From Novice to Professional"

    "Beginning ASP.NET 1.1 E-Commerce - From Novice to Professional"
    By Cristian Darie and Karli Watson

    Despite the monumental rise and gradual decline in the electronic commerce model, the lessons that one can learn from developing such applications are vast, timeless and applicable in so many more theaters than just payment processing or shopping carts.   Cristian Darie empowers you with the tools and talents you'll need to enable your web applications with simple shopping and fulfillment options.  

    The book's primary audience is the beginning to intermediate level ASP.NET developer who has the basics of ASP.NET and Visual Basic .NET programming under their belt.   It reaches out to the low-to-no-budget client who's looking for a high-impact solution without needing to spend huge amounts of capital.  

    The book's single application is a practical online storefront with payment processing examples given through both the popular PayPal and via a roll-your-own model.   All the major considerations for running an online store are included, such as the general model for customer fulfillment, developing a custom shopping basket and working with the order pipeline.

    The featured app's main driver for presentation is a single WebForm that dynamically loads user controls based on the page's post back state and/or query string values.   I'm personally not crazy about this model of web development, preferring templated independent .ASPX files without so much reliance on the URL and embedded values therein, but that's just me.   Nonetheless, the book leverages such a structural design, and does it well.   And, the tiered nature of the app makes changing the UI easy without breaking the more critical components.   It's a nice variation on a theme.

    The main blessing I found in this title (and at the same time the source of its greatest fault) is it's inseparable fit to Visual Studio .NET.   If you're of the crowd who live and die by Microsoft's prime .NET IDE it's great, but for those preferring to painstakingly hand-code their apps or use an alternative setup like ASP.NET Web Matrix and manually compiling assemblies, you're left with no alternative; it's a bit of a stretch to immediately understand the relationships between WebForms and business classes. 

    Thankfully the book is a tad more forgiving when it comes to the database server, frequently mentioning the differences between SQL Server and it's more laid back cousin, MSDE.

    And further, the web storefront's architecture is beautiful, consistent and easy to read.   You'll benefit from the nicely-laid out 3-tier model used throughout, and while the code isn't explained verbatim, the book emphasizes good object-oriented programming and the use of stored procedures and user-defined functions.   There's especially some really clever ADO.NET and T-SQL syntax even a guru will smile at and save for later use. 

    On that note, the book at times doesn't use what many first-generation ASP.NET developers might consider best industry practices and does present a couple of programming tricks which might be up for lively debate, (e.g., passing DataReaders between application tiers), but it does introduce some interesting ways to get things done, albeit in so doing swimming against the generally accepted stream.

    But beyond all the good tidbits and tips the book offers, the one shining moment that distinguishes it from most other texts in its genre is evident in the "Searching the Catalog" chapter.   The authors discuss the considerations, concepts and code required to built a (somewhat) scalable, quick and timely internal search utility.   This is one chapter and topic that no ASP.NET developer should go without reading, and the book is well worth the "price of admission" if you will, based on this chapter alone.   If you buy the book for any one reason - e-commerce or otherwise - it would be this chapter.

     However, the only downside I cited to the book's search discussion was the fact that it mentioned using Microsoft SQL Server Full-Text Indexing in principle only, and doesn't exhibit how to build a search tool using FTI.

    In short, this book definitively shows how to get a commerce-empowered site up and running quickly and easily with very few enterprise-level tools.   The search chapter is a must-read, and you'll learn much from a structured, methodic approach to ASP.NET development.


  • Reality TV works: ESPN Dream Job contestant asks me for advice on anchoring sports

    I had the thrill of the year this past week as Brian Startare, one of the contestants on the second season of ESPN's Dream Job, wrote me and asked me for advice on anchoring sports.  An avid fan of the first season and myself a TV sportscaster, I blogged about my thoughts on the strengths and weaknesses of each of the final four contestants prior to the big finale this past March. 


    Due to a deadline, I tragically missed the first episode of Season 2 where everyday people compete for gigs as SportsCenter anchors, so I didn’t catch Brian's performance.  He indicated that he did well on highlights but had a couple of issues on body language between his first story and the next, which is critical in segueing between pieces, physically exhibiting transition.  It's one of the smaller but important pieces of being a complete anchor.


    Break a leg Brian (that's a good thing)!  I promise to tune in and be rooting for ya this week!


  • My next book project: an autobiography of the ASP.NET community

    Hi everyone!  I've been out of the blogging circuit for a few weeks working on a side project.  Since my attempts at trying to get into Microsoft, and ESPN aren't proving fruitful I'm going to engross myself with a hobby for the next six months to pass the time.


    I'm drafting a proposal for a new book to shop to various literary publishers - an autobiographical recollection of the events and people that have made up the ASP.NET community over the last four years.  This would be the kicker of my career as a tech journalist.  The premise is basically to document and give an insider's look at some of the more notable (and undocumented) events that have emerged. 


    I've got a prologue mapped out mentally, so when it's down on paper, I'll post it for your consideration and criticism. 


    I'll cite the experiences and profile the careers and contributions of great devs like Scott Mitchell, Doug Seven/Donny Mack, Jonathan Goodyear, Steve Smith, Bill Evjen, Dana Coffey, Charles Carroll, Rob Howard, Scott Guthrie and others whose respective work helped create a thriving community experience and positive learning environment and really allow the Active Server Pages platform to ascend to its level of dominance.  And, if they'll let me, I'll give a bit of insight on the people behind the keyboards, showing who they really are and de-geekify them.


    And arguably, the kicker: the incidents that almost divided the community apart - the fiasco over ASPFriends. 


    So if you get an e-mail from me in the near future trying to setup a phone interview time, you may be in a book!



  • Book Review: ".NET Game Programming in C#"

    The first program I ever wrote was in 1984, being a text-based, command-driven NBA basketball game on an Apple IIe in BASIC. My, how games have progressed since. Having said that, I'm strictly a web developer, and from behind the comfortable confines of the web browser is about where my programming acumen begins and ends these days. But like most people my age (I'm 30) I grew up playing Nintendo and have long been a fan of video games.


    Being a user and not a creator, I'd long wondered how such things were brought to life, and this book does a great job of showing just that for the newbie.


    The code and concepts, despite the title, are fairly advanced, and not at all tutorial-driven, so not every line is described ad nauseum. So an open mind is needed to let it sink in. That having been said, the object-oriented nature and accessibility requirements for device hardware for modern video games is adequately described, with some very relevant games used as practical examples. The purpose of, need for, and uses with, Managed DirectX 9 is very nicely done.


    The authors use a very friendly voice, and cite several well-known games as exhibits of the fundamentals they describe throughout the text. For example, a Tetris offshoot is described in the book's initial chapter, demonstrating how such a simple game is likely a lot more complex in its design that you might realize, but simultaneously not as laborious as one might think.


    This book defines the major areas of concern for creating a great game, being that all elements within a good video game must exhibit some sort of (1) artificial intelligence, (2) spatial awareness, and (3) reactionary behavior in the event of collisions. I also now know I'll probably never be a good games developer, as one should be very patient, be really, really, really good at math, and use some pretty advanced OOP/OOD concepts to create a good game.


    Now being aware of the number of skills needed, algorithms with which to be familiar, and areas that are more deeply covered in other specialized books, this book won't allow you to create the next Quake, Grand Theft Auto 3 or Super Mario World right off the bat – but it will get you started.