Scott Hanselman

ASP.NET Rolled up Goodness

March 7, '05 Comments [3] Posted in ASP.NET | Javascript | Tools
Sponsored By

Here's a copy of snazzy things from various locations, while I'm on the road.

  • ASP.NET Popup Test Web Server Control (via Larkware) - Matt Berther makes detecting if popups are disabled simpler. Maybe he can make me one that tells me if JavaScript and/or Cookies are disabled?
  • Using Inheritance with ASP.NET Pages - This great article from Dino shows more than just how to create an inheritance heirarchy of ASP.NET pages, but more importantly it shows some techniques like:
    • Trapping the Browser Refresh - When you back up while browsing, you take the risk that you might re-POST a previous request. Dino has some clever ideas on how to detect that a POST has been "replayed."
    • Entertain Users During Long Operations - At Corillian we're often dealing with slow hosts/mainframes and web browsers don't lend themselves to long or asychronous operations. Dino shows a nice generic way to present long-running operations to the user.
  • MultiViewBar Updated - Andy's MetaBuilders site is a must-visit for any ASP.NET developer. Not only does he have a focus on cross-browser compatibility but his stuff just works. And it saves time. My favorites are the DualList, the RowSelectorColumn, and the infamous OneClick.

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 ORCS Web
Tuesday, March 08, 2005 4:35:06 AM UTC
I have something similar to the Popup Test Web Control for javascript here: http://www.structured-solutions.net/ASP.NETUserControltoCheckforJavascript.aspx
Andy Miller
Tuesday, March 08, 2005 6:24:03 AM UTC
Why do you want to detect a re-post?
If you do have a form on your page (like this comment form) and don't want users to submit it twice, just do an http-redirect after the first submit. This works great for POST and GET.
The user submits the form, the server gets the data and stores it away. After storing it, it redirect the client (before outputting anything) to the same url without the form parameters - only with parameters which tell the page what to display.
Voila! The browser now only stores the redirected URL in its history - you don't get the chance to repost your form by pressing the back-button.
As a side effect, you don't even get a message like "the page has been the result of a post operation - do you want me to post the data again?".

Or did I get the intend to detecting the refresh wrong?

Cheers,
Ralf

Tuesday, March 08, 2005 2:05:06 PM UTC
How to determine if JavaScript is enabled:
http://www.15seconds.com/issue/030303.htm
Comments are closed.

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