Jason Salas' WebLog

On-air and online: making people laugh, making people think, pissing people off

Sponsors

ASP.NET sites that kick ass

Pals with blogs

Podcasts I listen to

Using WebParts to develop sports contests

One thing I love doing as a sports journalist and web developer is creating demo apps based on sports.  In my opinion, one of the coolest and most logical achievements of web development was when ESPN.com circa 1998 put together a web-based contest, in which users would be presented with a straight-down listing of the top 25 college football teams in the nation, and be asked to rearrange them in the order in which the user thought the teams would finish the season and then submit their ballot in the hopes of some sweet prize. 

As one would expect, correct ballots would be archived, with the winner assumedly selected at random.

I've been messing with the pre-PDC Whidbey alpha bits to make this work for ASP.NET, using WebParts.  ESPN’s implementation, based on Java, did everything on the client, which made for a nice drag-and-drop interface, albeit taking nine years to initially load.

The concept for developing such as service in ASP.NET 2.0 is really simple, as membership isn’t explicitly required (changes don’t need to be tracked over time, which provides the opportunity for people to enter multiple times):

  1. Display a WebPartManager with 25 WebPartZones, listed vertically, each containing a team name, listed in no particular order
  2. Set “WebPartDisplayMode.Design” as the mode for the WebPartManager have the user resort by dragging-and-dropping the teams in their preferred order, re-indexing them each step of the way
  3. Set “WebPartDisplayMode.Normal” and submit the finalized order, citing the index position of each WebPart in the WebParts collection 

The documentation and gossip on the grapevine at this point don't seem to denounce an excessive use of WebParts within a single page, but even though in this example contains only static text for each team, would that be overkill or negatively affect the page?  One can safely assume that too many WebPart objects (or any type of control, for that matter) would have some sort of compounding impact on performance.

More to come, including implementation code…

 

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)