Scott Hanselman

ViewStateUserKey makes ViewState more tamper-resistant

November 18, 2004 Comment on this post [1] Posted in ASP.NET | ViewState
Sponsored By

Here's a little-known but very useful no-brainer to add to your ASP.NET application's base Page.

void Page_Init (Object sender, EventArgs e)
{
   if (User.Identity.IsAuthenticated)
      ViewStateUserKey = User.Identity.Name;
}

"What this does is key the view state to an individual using a unique value of your choice.  This option, which is only available in ASP.NET 1.1, is the Page.ViewStateUserKey. This needs to be applied in Page_Init because the key has to be provided to ASP.NET before view state is loaded."

For more good details on preventing tampering and best-practices with ASP.NET, visit Anil John's page on Authentication/Authorization and Defense in Depth.

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

What are you reading?

November 17, 2004 Comment on this post [15] Posted in Gaming | Tools
Sponsored By

Here's what I've been reading this month. These are all books that I'm in the middle of (have a bookmark in and they are on my night stand).

  • When Will Jesus Bring the Pork Chops? - George Carlin - It's offensive to many, but since he (and I) have interests in linguistics, I'm loving it.  The euphemism rant is worth the price of admission. Get the Audible version, it's better than the book.
  • Worlds of Exile and Illusion, Three Novels in the Hainish Series - Ursula Le Guin - I love anything she writes, I got hooked by starting with The Left Hand of Darkness. I'm looking forward to the upcoming SciFi miniseries Earthsea.
  • Three Books of Known Space - Larry Niven - Another author who can do no wrong. I'm also reading:
  • Ringworld Engineers, the Ringworld Throne, then Ringworld's Children - I got the Audible of Ringworld, and it was fantastic, even better then when I first read it as a kid.
  • Rainbow Six - Tom Clancy - This thing is a big-ass tome at 912 pages. But, I got it at Goodwill for $3, and while I won't take it with me on planes, I'm about 600 pages in, and it's gripping. It also increases my enjoyment of the XBox Game. (That's why I got the book in the first place!)
  • Ilium - Dan Simmons - I'm struggling with this big one. I started it because I loved the Hyperion series so much (which is a SciFi re-telling of Chaucer's Canterbury Tales).  This is a re-telling of the Iliad from a Sci-Fi point of view. I'm in the middle of it, but the names and places aren't clicking with me, and I have to keep referring to the glossary of characters. I should have paid more attention in A.P. English. Patrick Cauldwell would eat this up with his Liberal Arts Degree. :)
  • Servant of the Bones - Anne Rice - An odd one, but fun. From a quote on Amazon.com: "'Servant of the Bones' follows the format of the Vampire Chronicles: an incredibly attractive immortal relates his life story to a listener (who, oddly enough, never seems to need the bathroom during the long oral bio)." I'm enjoying it though...the immortal is Azrial, a fallen angel born in ancient Babylon. The history is a little odd, but the concept of extremely long lived folks (Highlander anyone?) is a very attractive concept for a story.

What are you reading?

P.S. Thanks to Kim Gräsman for Urlograph, an IE Toolbar Button that automatically shrinks Amazon and Google URLs! Very RESTful.

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

A Grouping and Subtotaling Repeater for ASP.NET

November 17, 2004 Comment on this post [0] Posted in ASP.NET
Sponsored By

Here's a slick Repeater at .NET Junkies. It does subtotalling and grouping. There's a number of ways to accomplish this kind of result, but I like Kurt's solution.

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

Interesting...Man Sets Himself on FIRE near the White House...and no one covers the story?

November 16, 2004 Comment on this post [10] Posted in Musings
Sponsored By

Patrick saw this on CNN for literally 5 seconds, but I figured this would be a lead story today.  A fellow tries to set himself on fire near the White House, and noone covers the story? It's not on CNN.com or ABCNEWS.com...it's buried on the Reuter's Wire.

UPDATE: It's trickling in now via Google News.

Color me reactionary, but when someone tries to self-immolate (thanks Patrick) I figure they're pretty upset about something.

I wonder what it could be?

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

Lutz Roeder's Documentor updated as a CodeRush Plugin/Visual Studio.NET Add-In

November 16, 2004 Comment on this post [0] Posted in XML | CodeRush | Tools
Sponsored By

Recently Lutz Roeder took Documentor off his list of .NET Tools, and I was bummed.  Mark Miller and I have been talking about doing a documentation plugin for CodeRush.  I was working on one that did MSDN style help, and Mark did one that was more stylized and painted directly over the XML Comments.

However, Travis Illig (who works with me) in his wisdom, emailed Lutz and got the source to the now defunct Documentor. He then updated Documentor and implemented it as a drop-in CodeRush PlugIn!

He adds a new VS.NET ToolWindow that will render the XML comment that your cursor is currently on as MSDN-Style Help. As you type, about a second later (when CodeRush parses next), the ToolWindow is updated.

This is nice if you're using NDoc to generate your MSDN-style CHM Help files and you want to use some of the more advanced (and useful) C# XML Comment tags, but are not sure how it's going to turn out.

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.