Archives / 2004 / September
  • Complex DataBinding with Date Formats in .NET 1.1

    Did you know that you can do some pretty complex things with .NET's late binding in ASP.NET 1.X? I had a problem where I needed to be able to kick out dates in a specific format. I didn't want to use a helper method, which involves compiled code, so I found a solution.

    1<%# CType(DataBinder.Eval(Container.DataItem, "DateAdded"), DateTime).ToString("dd MMM yyyy") %>

    Your datatype on the DataItem can be a string or a DateTime object. Either way, you must do the conversion first, otherwise there would be an implicit conversion, which is not allowed in late-binding code. The bold part is the name of the date property on the object you are binding against.

    As with any late-binding, you'll have a slight performance delay on the first hit, but that's just cause the page is recompiling. It'll be fine after that.


  • Help The Hurricane Victims

    All I can say is, I'm really glad that I don't live in Florida. But the people that do live there need your help. I can't even imagine what it would be like to live through four hurricanes within the same six weeks. The shelters are packed, and people need food and supplies. So please be as generous as you can, the holidays are coming soon. Click the links below to donate.



  • Tell MS To Put a Standard Icon Package in VS2005

    Microsoft hasn't updated their icon redistributables since VB4. There is a suggestion in the MSDN Product Feedback Center for Microsoft to add the Office 2003 / VS2005 icons to the installer, so that people can build standardized GUIs. Since Microsoft bases their priorities on votes, you can help us put it on Microsoft's radar by voting for it. It would be really nice of that made it into the RTM version.


  • User Group Presentation Tomorrow Night

    Tomorrow night I'll be giving a two-part presentation on the Provider Model for the Arizona .NET Users Group in Phoenix. Here's what I have on tap:

    Session 1: Understanding Provider Model Architecture

    I'll start out with a rundown of interface vs. base class architectural approaches, using GenX.NET and VisualBlogger as real-world working examples. We'll dive deep into the implementation in .NET 2.0, which is the basis for several new APIs in the BCL. Forget building custom providers (we'll do that later), I'll demonstrate how to build static, thread-safe Provider APIs.

    Session 2: Providers In Action

    This session will be heavy on the demos. Demo 1 will be an overview of ASP.NET 2.0, with a brief walkthrough of Visual Studio 2005. Specifically, we'll take a look at the Membership API and the new Login controls that hook into the API. Demo 2 will detail how to build a custom Membership provider that stores Member information in an XML file using typed datasets. And for my personal favorite, Demo 3 will take a look at how to use the new base class-based Provider architecture for ADO.NET 2.0 to create dynamic data access layers that can change based on the connection string.

    Tomorrow night, 6-9pm. Directions are here. Hope to see you there.


  • Phoenix Geek Dinner

    Hey all you victims of the "dry heat". I've started a "Nerd Dinner" blog for Phoenixites over at Jim Blizzard's I want to set up dinners for once a month, starting sometime in mid-October. I'm open to suggestions on day of the week and venue... right now I'm thinking Thursday nights at Arizona Mills Mall.

    And since Phoenix people are so special, I decided to give our blog a bit of Valley flair. Check us out.


  • OT: Want To Win $100,000?

    I know you do. Jim and James, those enterprising guys that brought you, are running It's a twist on the old fashioned "get-out-the-vote" drive. It's pretty much a bribe to get voters registered, but hey, whatever works. You gotta love democracy. At any rate, it's for US Citizens only, and you have to be a registered voter of any party. If you're not registered, they provide links to do it electronically. There are only 47 days until the election, and you have to be registered soon. So what are you waiting for? Get started here, and we both could win $100,000.


  • Programmatically Loading TemplatedControl Templates

    One of the tricks I learned a while back was that, when using any kind of templated server control, you can put the template definition in a user control, and load it programmatically using Page.LoadControl(controlLocation). This is particularly useful in large web applications, where you may use the same template over and over again. This way, if you make a change to one, it gets propagated to all instances.

    It's also useful to note that Page.LoadControl instantiates the user control's class, so any events, like the Load event, get fired. Initially, I thought that maybe it just parsed the text in the control and instantiated what's in the text, but thankfully, that isn't the case. It's extremely important in my situation, because the template I'm loading contains it's own templated control that must programmatically load a template.

    At any rate, hope this information is useful to someone.


  • ComponentArt Releases Web.UI 2.0

    In all the hubub of late, I forgot to give mention to the fact that ComponentArt has released Web.UI 2.0, their new component suite. I've been working with this version for almost 6 weeks now, and I have to say that these guys really know how to do things right. Their stuff just keeps getting better all the time. They've completely re-written ASPnetMenu, which is now Menu 2.0 for ASP.NET, and it's really a pleasure to program against. The really awesome thing about it is, now you can nest User Controls as menu elements. It's wild some of the things you can accomplish now.

    At any rate, I'm using all of their controls very heavily in a new project I'm working on, and I couldn't be happier with the result. If you need some high class navigation controls, forget Infragistics or ComponentOne. Check out ComponentArt instead.


  • Changes On This Site

    Scott pushed new changes to sometime earlier this week. I hate very strongly dislike them. I don't hate them because the posts are shorter. I don't hate them because they make you click through to the posts. I hate very strongly dislike them for 3 reasons:


  • I LOVE the new MSN Music Store

    The verdict: WAY better than iTunes. I just spent some time surfing the new beta site, and I'm floored. My favorite parts:

    • No client to download. Apple is so hell-bent on lock-in (why the heck is no one complaining about THEIR anti-competitive behavior) that they won't even put their catalog up on a website. At MSN Music, I can browse their catalog of songs, listen to 1 minute clips (longer than iTunes) and buy without having to download a fat client.
    • Huge selection. MSN Music has 31 tracks for Jeremy Camp, iTunes: 4. It looks like the strategy with MSN is to get as many of an artist's songs as possible, versus getting a few songs from a lot of artists. I think it's a good plan.

    I think iTunes is very snobby about how it handles it's music business. For once, Microsoft is the one that is open about it, and I think that the downloadable music biz is really going to heat up. I think Real has the right idea with their pricing, but it is up to us to drive down the price of buying music online. Note to all the players: you'll move more songs if it's not still $15 to buy a complete album. I can pay that at the music store, and I get a CD and liner notes too.

    Two thumbs up for Microsoft's foray into the music store biz. Now I just need to wait until tomorrow for the Windows Media Player 10 Final.