Robert McLaws: FunWithCoding.NET

Public Shared Function BrainDump(ByVal dotNet As String) As [Value]


<script type="text/javascript"><!-- google_ad_client = "pub-4330602465258980"; google_hints = "ASP.NET, VB.NET, C#, C#.NET, WindowsForms, .NET Framework, VS2005, Visual Studio, XAML, WinFX, Windows Workflow, WPF, WCF, Atlas, NetFX3, Visual Studio Orcas"; google_ad_width = 120; google_ad_height = 240; google_ad_format = "120x240_as"; google_ad_type = "text_image"; google_ad_channel ="4997399242"; google_color_border = "B6C9E7"; google_color_bg = "EFEFEF"; google_color_link = "0000FF"; google_color_text = "000000"; google_color_url = "002C99"; //--></script> <script type="text/javascript" src=""> </script>

You should feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever. That said, I will most likely only delete abusive, profane, rude, or annonymous comments, so keep it polite, please.


Cool .NET Articles

My .NET Tools

My Articles

My MSKB Articles

September 2004 - Posts

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.
Team System - WHY Active Directory?

Hey Microsoft... WTF? What is the deal with forcing companies to have Active Directory deployed to use Team Foundation Server? Why not just use ADAM and make it transparent to the deployment process?

Suddenly, it makes the whole concept much less appealing.

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:

  1. No more blog list on the home page. I liked it much better when it was grouped by number of posts. Then, you didn't go to the bottom of the list, because nobody cares about someone who posts 3x and then loses interest.
  2. RSS feed truncation. What's the point in having a feed if you're not going to syndicate the whole thing? I thought there was an optional feature that could be used to do this... why am I being forced to do it if I don't want to? Why is it being forced on my readers?
  3. It doesn't solve the real problem.

So what is the real problem? The problem is, there are too many people blogging here. The question I have is, why on earth are MS people being syndicated in two different uncategorized places? Why do other members of the community have to deal with this crap? Microsoft doesn't like to be called the Borg, but the feed is like being plugged into the Hive Mind. It's a jumbled, disorganized disaster. Microsoft has zero blogging strategy, and it shows.

So, if you're going to shorten the aggregate home page, fine. But you'd go a long way to saving on bandwidth costs if you just moved the Microsoft people to once and for all, and gave back to the community where it belongs.

My point is not so much that I'm bagging on Rob or Scott or anyone else. I'm a huge .Text fan. They're getting a lot of crap right now, and they only kind of deserve it. Some community discussion would have been nice, or some private warning. But my point is that Microsoft as a company has no corporate blog strategy whatsoever, and the community is getting the short end of the stick because of it. Something has to be done, and it's not just ScottW and Rob's problem. It's Bill and Steve's problem.

More Posts Next page »