Scott Hanselman

Work continues on dasBlog...

January 30, '05 Comments [4] Posted in ASP.NET | DasBlog | Bugs
Sponsored By

The team's work continues on dasBlog. You can see the moment to moment details in the Bugs or Tracker section of SF.

If that's too much data, there's a roll up on the Wiki that shows the bugs, new features and goodness that'll be in an upcoming "point release" of 1.7 if you've been wisely hanging back while we tighten the screws.

Here's some highlights:

  • Admin: UploadImage and UploadAttachment have returned in their previous incarnations. We also include the Image Gallery (which some people dig immensely) and support for an RSS Enclosure.
  • Macros: We support two new macros for "Compressed Titles" that can allow dasBlog users to completely remove the look of "permalink.aspx" in lieu of something like: http://www.hanselman.com/blog/WorkContinuesOnDasBlog.aspx. Some tweaks and controversy remain. We shall see.
  • Small Breaking Change: The TitleList macro will require parens to be called, ala TitleList().
  • And lots of small bug fixes.

More soon.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Is this a good idea? Has it been done? Should it? An Aggregating ToString() implementation...

January 28, '05 Comments [14] Posted in ASP.NET | NUnit
Sponsored By

Travis and I were kicking around this idea. It's either already been done and it's a great idea, it's a good idea and no one has bothered, or it's stupid because _______.

We use a lot of "Domain Objects" like say, "public class Person." Why not have a "aggregated" ToString override like this:

Person p = new Person("Scott","Hanselman",new DateTime(1974,1,22);
//blah blah blah
string foo = p.ToString("My name is {FirstName} {LastName} and my birthday is {Birthdate:MM/dd/yyyy}");

Is this stupid? Would it gain you anything over:

string foo = String.Format("My name is {0} {1} and my birthday is {2:MM/dd/yyyy}",p.FirstName,p.LastName,p.BirthDate);

I've got it half done, but I wanted to know your thoughts before I finish it.

My thinking is that, even though it'd be slow (Reflection) it's useful for these reasons:

  • Quick Testing - Seems convenient to me, useful for NUnit.
  • Ultra-Late Bound - Ya, I know I'm Mr. So-Early-Bound-I-Generate-Everything but sometimes you just don't know until late, which leads me to:
  • Externalization of Complex Formatted Strings - True, you're embedding knowledge of your properties in a string, but it'd allow you to add a different series of fields if another language required it. This would be an improvement over ordinal style ({0}, {1}) format strings, no? Perhaps a silly use case.
  • DataBinding - You can let an ASP.NET DataGrid just call ToString on an object and it'll "do the right thing" as opposed to doing a TemplateColumn or an OnItemDataBound callback.
  • It just calls down into the underlying object's ToString - It's basically using the aggregate ToString's format string to get Properties and Fields and call their respective ToString's using the embedded (after the colon) format string.

Am I smoking crack?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Turning off AutoComplete for TextBoxes in IE and FireFox

January 27, '05 Comments [6] Posted in ASP.NET
Sponsored By

This is one a lot of people know, but it's worth covering again because it's easily forgotten as it's a small detail. Since we do eFinance sites, we often don't want folks' UserNames collected and stored in AutoComplete, especially when the site is browsed on a public machine.

<form id="formSignOn" autocomplete="off" method="post" runat="server">

Note that autocomplete="false" doesn't work. However, autocomplete="off" works in both IE and FireFox.

Thanks to Johnson Michael for reminding me of this tip.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Internet access (and Skype) at 36000ft. Schweet.

January 26, '05 Comments [6] Posted in Musings
Sponsored By

Clemens is such a stud. He chatted me last night around 8:20pm PST and was flying SAS to Copenhagen. Apparently for $30 you can get internet access while on the flight. OMG. That would so make a long-ass trip easier.

If you look REALLY close at his laptop screen, you can see my Tiny Wedding Picture (you remember that one) in the corner of MSN Messenger.

He tried to Skype me as well, but either the bandwidth wasn't up to snuff or the roar of the plane was too much for the noise cancelling.

Interestingly, I could hear him typing, and he I, but we couldn't understand speech. Either way, I hope this becomes standard fare. It all done by bouncing off sattellites. I would love to run some TraceRTs on that connection.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

BUG?: Can't use an Asterisk (*) as a character when requesting a URL (page) from ASP.NET

January 26, '05 Comments [8] Posted in ASP.NET | DasBlog | HttpModule | Bugs
Sponsored By

File this in obscure. I'm trying to fix a bug filed against dasBlog where the guy has a Category in dasBlog called "WS-*"

He filed a bug saying that the CategoryView doesn't work, presumably because it has an asterisk. Now, I KNOW asterisks are allowed in values of querystrings, so this seemed weird to me.

Turns out he's using the UrlRewriting feature of DasBlog so he gets URLs like this:

http://localhost/DasBlog/CategoryView,category,WS-*.aspx

The idea is to fool search engines into thinking there are actual pages, instead of one page with an URL like:

http://localhost/DasBlog/CategoryView.aspx?category=WS-*

Here's where it gets weird. We use a thing called the UrlMappingModule to catch ALL requests (all the requests that are handled by ASP.NET) and then call app.Context.RewritePath(newPath) which routes, in this case, the request to CategoryView.

However, if an asterisk (*) appears anywhere IN THE (purported) FILENAME, ala CategoryView,category,WS-*.aspx then ASP.NET never hears about it, the HttpModule's BeginRequest never fires and I can't do crap about it. All I see is an HTTP 400 Bad Request.

So, without digging further, I can only assume that the ASPNET_ISAPI extension didn't think it was cool to pass the request on. Of course, when the * appears as a value int the QueryString, everything is cool.

What other component/filter/module upstream might be slapping this request down? I'm not running any thing special on this development box.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.