Scott Hanselman

Buy a Microsoft Mouse and Keyboard today, deprecated tommorow

June 3, '04 Comments [4] Posted in Musings
Sponsored By

Is it just me, or do you visit the Microsoft Hardware site every week or so, just to see if the $150 Wireless Keyboard/Mouse kit that you to see if it's been deprecated?

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

Web Services Theory - New Class

June 3, '04 Comments [0] Posted in Learning .NET | Web Services | XML
Sponsored By

My buddy and co-worker Patrick Cauldwell is teaching a new class on Web Services Theory at OIT Portland on 185th and Walker.  It'll be Monday and Wedsnesday night at 6pm.  Patrick and I worked together in conceiving this class, and we are hoping to make it a three-part series: Web Services Theory, Web Services Applied, and Web Services in the Enterprise.

This is a class that you could send folks from your company to, they just need to enroll in OIT.  It's usually very straightforward and the class is inexpensive.  Definitely a bargain and a great way to learn about Web Services from a Web Services Architect at Corillian. Patrick also co-wrote a book from Wrox on Web Services, and deisgned the XML and Web Services curriculum at STEP Technology back in the day.  (Disclaimer: This class is not affiliated with Corillian in any way, it's given at the Oregon Insititute of Technology, a university in the Oregon State System of Higher Education.)  Spread the word!

I'll be teaching CST 407 Web Services Theory at the Oregon Institute of Technology (OIT) this summer.  The class is Monday and Wednesday evenings for 4 weeks, June 21nd - July 14th.  Registration is open if you are interested.  I'll be focusing on the theorectical aspects of Web Services and Service Orientation, so if you're interested in getting a good grounding in that part of Web Services, come on down! [Patrick Cauldwell]

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

Important Note: Replacing the default ViewState Persistance Behavior

June 3, '04 Comments [2] Posted in ASP.NET | ViewState | Bugs
Sponsored By

Scott Mitchell also has a good article on ViewState up on MSDN.

I talked to him before I blogged this and he agreed it was worth mentioning.  I blogged about this issue before

In his article Scott shows how one can override SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium to put ViewState somewhere else.  A few snippets are below:

   protected override void
     SavePageStateToPersistenceMedium(object viewState)
   {
      LosFormatter los = new LosFormatter();
      StringWriter writer = new StringWriter();
      los.Serialize(writer, viewState);
      StreamWriter sw = File.CreateText(ViewStateFilePath);
      <snip> 
  
}
   public string ViewStateFilePath
   {
      get
      {
         string folderName =
           Path.Combine(Request.PhysicalApplicationPath,
           "PersistedViewState");
         string fileName = Session.SessionID + "-" +
           Path.GetFileNameWithoutExtension(Request.Path).Replace("/",
           "-") + ".vs";
         return Path.Combine(folderName, fileName);
      }
   }

In this example code (that you shouldn't copy/paste into production :) ) you see that he's redirecting ViewState to serialize to a file with a name like ASPNET23234094498230948320492834-myfile-default.aspx.vs. 

The problem (an edge case certainly, but still a problem) with this approach is that it doesn't support multiple browser windows on the same machine hitting the same page

Remember where ViewState is stored by default - it's stored with the requested page instance (in the HTML).  Using the ASP.NET SessionID in the filename scopes the state to the user and adding the file name reduces scope to the Page Declaration, but not the actual request instance.

Fortunately, Scott Mitchell wisely aludes to a solution in his article when he says:

Note   One workaround would be to use a globally unique identifier (GUID) as the file name for the persisted view state, saving this GUID in a hidden form field on the ASP.NET Web page. This approach, unfortunately, would take quite a bit more effort than using the SessionID / URL scheme, since it involves injecting a hidden form field into the Web Form. For that reason, I'll stick to illustrating the simpler approach for this article.

I spoke with Scott, and he agreed that for this solution to be more ideal one would have to implement a solution using a GUID.  Otherwise, be aware that you may run into flakey concurrence bugs where pages step on each other's ViewState.

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

Today's Errors: "Unexpected Error 0x8ffe2740 Occurred" Error Message When You Try to Start a Web Site and "Not Running ASP.NET Version 1.1" Error Message When You Try to Open an ASP.NET Web Application Project in Visual Studio .NET 2003

June 3, '04 Comments [6] Posted in ASP.NET | Web Services
Sponsored By

Good times, good times.  Twenty minutes before a demo to a bank, I get this:

"Not Running ASP.NET Version 1.1" Error Message When You Try to Open an ASP.NET Web Application Project in Visual Studio .NET 2003

Now, of course, I know darn well I'm only running .NET 1.1 on this box.  Hell if I know what's going on, but I've done the whole ASPNET_REGIIS thing before, so I run aspnet_regiis -ua, then aspnet_regiis -i (I could  have just done -r, probably).

Didn't work. I DO have some funky stuff in my Web.config customerrors section that has a defaultredirect.  Ah! http://support.microsoft.com/?id=825792 says:

"If the defaultRedirect attribute is set to an HTML file or to an ASP file, the request for the Get_aspx_ver.aspx file does not return the ASP.NET version information."

Bingo? No...now I get:

"Unexpected Error 0x8ffe2740 Occurred" Error Message When You Try to Start a Web Site

I see the 0x8ffe2740 and a Stop Sign in IIS's MMC. Turns out another process started up while IIS wasn't running and took over Port 80.  Running TCPView made it clear.

So, 13 minutes spent Googling and Troubleshooting.  Demo looks good and I've got 7 minutes to blog about it.

Would this be a good interview test problem for a potential employee?  Like, literally give them a laptop with this problem and say "fix it."  My CTO could have solved this problem as well in similar time, but I wonder (as I read Google Groups) if there aren't people who would waste days on this kind of problem.  Thoughts?

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

Section 508 Accessibility and ASP.NET

June 3, '04 Comments [1] Posted in ASP.NET
Sponsored By

I've be interested in Web Accessibility for a while, and collected a pile of links about it in 2002 for a project.  I even turned off my monitor for a day and ran "Jaws," a screen reader for Windows that blind people use. (Seriously, try this one day - if you ever go blind, at least you'll know how you'll keep your programming job.  It was comforting to know that I could keep my job.)

Scott Mitchell has a great article on accessibilty up on MSDN.  Kudos to Scott for this; there just aren't enough people who realize the need for accessibilty and few people take the time in their projects to make a site truly accessible.  You don't know how many customers you are losing if they can't even get to your site.

It's great to know that ASP.NET 2.0 will generate Section 508 compliant markup by default.  Nice to know there is some commitment.

If you need Section 508 compatibility now, you can patch the ASP.NET 1.1 DataGrid TODAY with the June 2003 Hotfix (Q821156).

Also, be sure to check out Mark's Dive Into Accessibility book, it's an invaluable download. 

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.