Scott Hanselman

Binary Fortress Software's ASP.NET ViewState Helper - A Treasure Trove of Tools

February 22, 2007 Comment on this post [2] Posted in ASP.NET | Reviews | Tools | ViewState
Sponsored By

I was working on some demos here at Corillian and I needed to check the size of the ViewState on a page. There's lots of ways and lots of tools that can help you do this. Certainly FireFox's Web Developer Toolbar, while not specific to ViewState, can help you analyze a page.

Nikhil Kothari's Web Development Helper is also very good at this, but requires a little more setup and ASP.NET 2.0. An awesome tool, though.

I stumbled on Binary Fortress Software's ASP.NET ViewState Helper (their support forum is brand new, but if you have trouble go there).

What a slick tool! A 300k download, and works on ASP.NET from the outside - by futzing with IE's object model. It watches you surf and collects statistics. You can then double click on any of the pages and view the decoded ViewState.

I like a tool that does its job, doesn't run inside of IE (I've had it with Browser Helper Objects), and gets out of the way when I'm done. Recommended. This tool is a very useful addition to your c:\utils.

(BTW, their Web Performance Monitor has promise too, but I haven't looked at it yet).

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

OpenDNS

February 22, 2007 Comment on this post [20] Posted in Tools
Sponsored By

Use OpenDNSDNS is one of these things that we just take for granted. You type www.cnn.com and it resolves to an IP Address.

Who've have thought you could take a stodgie old protocol like DNS and hack a business model around it?

UPDATE: One of the founders of OpenDNS, David Ulevitch, has responded with some helpful info in the comments area.

OpenDNS has. Just set you DNS settings to 208.67.222.222 and 208.67.220.220 or click the button in the upper right corner of this post.

Interestingly, that button is a SMART button. If YOU are already using OpenDNS, you'll see one image, while everyone else sees the other.

They not only offer faster DNS lookups, but they'll

They make their money when you completely booger up a domain name, or DNS doesn't resolve, and you'll get a search page with their advertisers on it.

Now, to be clear, the protocol purists will hate this, declaring things like in the comments here:

I also don't like that "spelling correction" or "anti-phishing" feature. That doesn't belong in the cache; it belongs at the resolver. I would agree [snip] — OpenDNS is unsuitable for use as an enterprise DNS cache. It might be a good solution for people who want to run their own personal cache on a local node.

Personally, I'm loving it. I loves me a clever hack and this be one. Take a look at their FAQ. Since there's no software to install, and you can undo it anytime, it seems harmless to me.

If you want to try it with nslookup on Windows, remember to include the trailing . after the domain name.

C:\Users\Scott>nslookup www.craigslist.org.
Server: resolver1.opendns.com
Address: 208.67.222.222:53

Non-authoritative answer:
Name: www.craigslist.org
Address: 66.150.253.241

C:\Users\Scott>nslookup www.craigslist.orr.
Server: resolver1.opendns.com
Address: 208.67.222.222:53

Non-authoritative answer:
Name: www.craigslist.orr
Address: 208.67.219.41

Notice how the misspelled domain points to a 208.67.x.x address? That's OpenDNS. They'll redirect requests to craigslist.orr to the real site, that's how they handle misspellings - they're actually misspelled in the cache.

Take a look at their http://system.opendns.com Status page. They are pretty hard core. I'll be hooking the parents and relatives up with this one, ASAP. If you're a parent or relative of me, go here to the Getting Started Page if you like, and follow the instructions, and call me if you have trouble. When you're done, visit http://welcome.opendns.com and you'll know if it worked or not.

Comcast's (my ISP) DNS tends to suck, and I have been compensating by running DNS Masq here at the house on my Linksys Router.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

LifeHack: Carry Fewer Club Cards with BarCodes and lose the Costanza Wallet

February 22, 2007 Comment on this post [7] Posted in Musings
Sponsored By

I've been meaning to scan the six stupid "club cards" that The Man uses to track me as I do my shopping around town into one single card like this guy.

This has been more on my mind since I started using the Umbra Bungee Wallet exclusively. I freaking love this wallet. No more Costanza Wallet for me.

Now I've created a custom single uber-club-card (Yes, I know they are tracking me, and No, these aren't my real numbers) using JustOneClubCard.

It's just a little web app with a list of stores (mapped in the background to that stores barcode-style) that generates little double-sided cards for your wallet.

Elegant, clean, simple, very Web 1.5. Now I have six fewer key-chain dealies to carry around.

Thanks to JustOneClubCard, the Mark of the Beast is now that much more convenient to carry.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Using ISAPI_Rewrite to canonicalize ASP.NET URLs and remove default.aspx

February 21, 2007 Comment on this post [18] Posted in ASP.NET | HttpModule | Musings | Tools
Sponsored By

In the comments of my post on Google PageRanks, Jeff Atwood says:

[The existence of] Default.aspx is another reason to consider URL rewriting. A few of my rewrite rules relative to PR:
- I don't allow links to come in as codinghorror.com, I add the www. if it is not there.
- I remove index.html if it is present

This got me thinking, as it appears that are quite a few ways to get to my home page.

You get the idea...Heck, probably just by mentioning them I'm getting in trouble, right? The URI that dare not speak its name.

Away, if we start by assuming my home page is http://www.hanselman.com/blog/ and that includes the trailing slash. We know that if my browser requests http://www.hanselman.com/blog without the slash, it'll be told by the Web Server to try it again anyway, which is just wasteful.

Apache folks have mod_rewrite and love to remind ASP.NET/IIS folks about their awesomeness. Many sites rely on mod_rewrite for certain behaviors. It's really a fundamental part of the Apache experience. The IIS story becomes better in newer versions of IIS, but the easiest and most flexible way to handle these kinds of things is ISAPI_Rewrite.

Sure, one could create an HTTP Module for ASP.NET for some of this, but at some point you'll realize that you need to catch these requests WAY earlier. Now, ISAPI_Rewrite uses Regular Expressions, and now it's time for my oft-repeated favorite RegEx joke - get ready for it:

"So you've got a problem, and you want to use Regular Expressions to solve it. Now you've got two problems."

Thanks for indulging me. Yes, writing ISAPI_Rewrite stuff is freaking voodoo and I hate it. Once you've written them, they're done. Here's mine:

[ISAPI_Rewrite]
RewriteRule /blog/default\.aspx http\://www.hanselman.com/blog/ [I,RP]

RewriteCond Host: ^hanselman\.com
RewriteRule (.*) http\://www.hanselman.com$1 [I,RP]

RewriteCond Host: ^computerzen\.com
RewriteRule (.*) http\://www.hanselman.com$1 [I,RP]

RewriteCond Host: ^www.computerzen\.com
RewriteRule (.*) http\://www.hanselman.com/blog/ [I,RP]

This rules normalize (canonicalize), to the best of my ability, all the not-really-good URLs above. It'll put everyone to http://www.hanselman.com/blog/ and even take totally lame links like http://computerzen.com/blog/GooglePageRanksConsideredSubtle.aspx and make then "correct." The "I" means "case insensitive" and the "RP" means "Redirect Permanently" - an HTTP 301. If it was just "R" it'd be a 302. When you're testing with ISAPI_Rewrite, always start with "R" to do temporary redirects, because you don't get a second chance with a 301.

So now, even if someone asks for http://www.hanselman.com/blog, they'll be told where to go(here's an HTTP conversation):

  • GET /blog HTTP/1.1
    • Heh, uh, get me /blog, m'kay?
  • HTTP/1.1 301 Moved Permanently
    Location:
    http://www.hanselman.com/blog/
  • GET /blog/ HTTP/1.1
    • Gosh, sorrey (my browser is Canadian) get me /blog/ then.

And it was Good™.

This kind of control is useful in any public facing application or web site and one should take an hour or so and really think about their website's "public face." ISAPI_Rewrite can be a powerful component as part of a larger ASP.NET solution, especially one where Google Ranks do matter and hackable or "pretty" URLs are highly valued.

For us, in the banking industry, having nice URLs like http://www.foobank.com/banking/ or http://mobile.foobank.com makes everyone happy.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Google PageRanks considered subtle

February 21, 2007 Comment on this post [17] Posted in Musings
Sponsored By

I did not know my Google PageRank until Phil mentioned it to me a while back. Apparently it's like the Richter (not Jeffrey Richter) scale in that a Page Rank of 6 is 10 times "better" than a Page Rank of 5, if I understand correctly.

Someone approached me to do advertising on the site, and since the bandwidth bill is due, I quoted a price I though was reasonable. She said, "but you only have a Page Rank of 5." This, for a moment, I become aware of this number since this advertiser cared.

I looked in the Google Toolbar and saw this:

Ok, looks like my Page Rank is 5, seems reasonable. However, later I noticed that if I was at http://www.hanselman.com/blog/ (note the lack of default.aspx) the Page Rank was 6. Seems like even though the home page is the home page, if there's a default.aspx at the end, that's a less "powerful" page.

I can only assume that more folks link to http://www.hanselman.com/blog than to the page with default.aspx. Apparently 10 times more, which seems reasonable.

I mentioned this to Phil who said, "weird, let me try" and sent me this screenshot where his Toolbar says my page is a 7. If I understand it, that's 100 times more shiny than a 5. Or, just +2. Who knows.

if Google's PageRank system is this subtle, and URIs aren't well canonicalized in their system then what's the point, Dear Reader? I know not. Seems like voodoo to me.

UPDATE: This post on the WebMaster group in response to another user says:

The page rank you see is not the pagerank Google uses.

- The pagerank you see is exported 3-4x/year

- It is "guessed" at whenever the page did not have a pagerank back
then. So if you have a "toolbar pagerank" (the one you see) TBPR 3 for
your homepage, and add a new sub-page, it will guess your sub-page to
be (perhaps) PR2, even though it doesn't have a real value for it yet.

- It is page-based ("page" rank :-)), not domain / site based

- Your sites internal interlinking structures determine how pagerank is
distributed among the pages - in the simplistic example where you have
a single page with is fed with pagerank (from the outside), you could
determine how that pagerank is spread among your pages based on the
link-structure in your site. You'll likely just give up if you have
more than 5 pages though :-) - it's not worth it.

- Your example with the homepage with a high PR and the other pages
having lower PR is perfectly normal and could be a "steady state"

Interesting stuff.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

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