-[Danny Chen]- Blog of an ASP.NET QA tester

The ASP.NET weblogs are still using .Text which, frankly, is a bit annoying to work with and just plain 'old'. Pete LePage showed me the MSDN blogs which use the (much newer) Community Server 2.0 codebase so I'm going to switch to it. They look much cooler anyway. Hopefully my blog will still be syndicated on ASP.NET so the readers can keep up to date with my happenings.

There's a bug in the IE7 beta which seems to break the style builder. Of course we'll work on getting it fixed but in the meantime, if you happen to have IE7 installed, there's a workaround you can apply.

Thank you everyone for sharing your code with me. There were quite a few excellent submissions and I learned a few things. Here are the top entries I received so far for the challenge. I'll add to this list if any more come in that I feel are worth mention.

Do you want to help make ASP.NET and Visual Studio even better in the next version? We are looking for the brightest and the most talented candidates to fill some challenging positions in our team. If you think you have the skills, guts, and determination to help improve the lives of web developers and shape web technology for the future, follow this link and submit your resume.

It is a fairly well known technique to use Response.Buffer and Response.Flush to make a "please wait" or "Loading..." message appear when you know a page is going to take a while to load. So I was quite estatic when I read on ScottGu's blog that someone (Daniel Fisher) had done what I've wanted to do for a while: formalize this trick into a nice tidy custom control you can just drop onto a page. You can see it here: http://www.lennybacon.com/PleaseWaitBuildingAWaitScreenControlForASPNET.aspx. It is really a very slick control. However, there was one problem I couldn't (and still can't) figure out which stopped me from writing this control initially. When I look more closely at Daniel's code, I noticed that he hadn't solved this problem either.

Here's a quick tip that you may or may not know about. In Visual Studio (and possibly other MS programs) it's not enough to paste some unicode content into your file and then hit save. You'll also need to save it with the correct encoding. However, once you save the file with a particular encoding, it will continue to use that encoding until you switch it (this means you won't have to keep doing this for each save)

This is a bit of a follow on to my last post. At the end, I made an update about how to make use of custom TreeNodes in a databound scenario. I did that example with the CSSTreeNode instead of the TemplatedTreeNode because the custom property in the templated case was an ITemplate. Trying to assign a value to that property is a great deal more difficult than a string property. And that got me thinking...

namespace MSSamples{///<summary>/// TemplateLibrary - custom control that holds a list of templates/// This control provides a way to store an arbitrary list of templates/// provided declaratively to it through mark-up. The templates are /// made accessible through a property to any other object that needs them///</summary> [ParseChildren(true,"Templates"), PersistChildren(false)]publicclassTemplateLibrary : Control {public TemplateLibrary() { _templates = newTemplateList(); }

// The List<TemplateItems> so that a string indexer// can also be used to reference items. (This isn't// the most efficient running algorithm, but I don't// expect a significantly large number of items to // end up in the list and it is memory efficient.)publicclassTemplateList : List<TemplateItem> {publicTemplateItemthis[string key] {get {foreach (TemplateItem ti inthis) {if (string.Compare(key, ti.Name, StringComparison.InvariantCultureIgnoreCase) == 0)return ti; }returnnull; } } }

// The Template// Since it isn't "known" what the exact type of container// will be used to instantiate a template, I just assume all// of them will implement the IDataItemContainer interface,// which is a good idea anyway for containers. [PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(typeof(IDataItemContainer))] publicITemplate Template {get { return _template; }set { _template = value; } }

// This is just to help reduce one level of dereferencing // needed to get a handle on the template object. #region ITemplate Memberspublicvoid InstantiateIn(Control container) { Template.InstantiateIn(container); } #endregion }}