Browser tip for generating fresh GET request after a page has been POSTed

Onion Blog

Syndication

I've been meaning to mention this tip for a while - I first saw Stefan Schackow use it at his ASP.NET: Under the Covers talk at TechEd 2006. If you have loaded a page and posted it (by pressing a button or postback generating link) and you want to go back to the page as if it were the first request, you can change the capitalization of the URL and the browser will treat it as a fresh GET on the URL.
 
The way Stefan did it was to toggle the capitalization of the 'x' in the .aspx extension:
 
You can repeat as needed (go back to a lowercase x, then back to upper, etc.) This especially useful for working with ASP.NET pages where you often post back many times to the same page, and this technique is the simplest one I've seen to generate a fresh request.
 
 

Posted Aug 10 2006, 08:51 AM by fritz-onion
Filed under:

Comments

Ben Scheirman wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 7:04 AM
I usually just hit F6 (to get focus on the url) and ENTER to Get a fresh load without POSTing any variables. then I do a ctrl+F5 to force a full refresh.

Since it's all keyboard strokes, it's 2nd nature now and is quite fast.
Fritz Onion wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 7:07 AM
Using F6-Enter works for me in Firefox, but not in IE. In IE the only way seems to be to create a new window or change the URL.
Ryan Rinaldi wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 7:14 AM
If there isn't a querystring I just pop a ? at the end of the url. If there is I just add a & at the end of the querystring.
Ben Scheirman wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 7:59 AM
F6 works for me in IE.

I used to watch my old boss copy&paste the url, then click home (about:blank) and then paste the url back in.

Adding a ? will probably always work because the browser won't cache a dynamic url... can you confirm this?
Joshua Flanagan wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 8:35 AM
I always just add a space to the end of the URL and press Enter.
Tim Barcz wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 8:41 AM
Fritz,

here's a bookmarklet that I just wrote to automatically change the case of the last character. If you put the bookmark on the toolbar all you have to do is click it to "refresh" the page with the changed url.

Here's the "url" for the bookmarklet (let's hope it survives a encoding.

If you find this useful please let me know, I may blog on my own site about this if people find this interesting.

javascript:var loc=document.location.href;var lastChar = loc.substr(loc.length - 1); if (lastChar == lastChar.toUpperCase()){lastChar=lastChar.toLowerCase()}else{lastChar = lastChar.toUpperCase()};document.location.href=loc.substr(0,loc.length-1) + lastChar;
Fritz Onion wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 9:15 AM
Nice Tim, I like it!
Arnaud Weil wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 10:21 AM
Of course it is interesting, Tim! By the way, what's your blog's URL? http://www.timbarcz.com/ seems not to be online...
Tim wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 10:25 AM
I'm working to put up a DasBlog or maybe WordPress engine. Currently my blog (when I post) is located at http://www.dotnetjunkies.com/weblog/timbarcz
Tim wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-10-2006 10:51 AM
Here's a post I sent out to other developers in our office. Here's the url to my blog post about this all. It describes how to make a bookmarklet ect.

http://www.dotnetjunkies.com/WebLog/timbarcz/archive/2006/08/10/143616.aspx

If this is handy please leave a comment on my blog and let me know. I'm a budding blogger and would love the feedback.
Jason Haley wrote Interesting Finds: August 10, 2006 - Part 1
on 08-10-2006 6:05 PM
Sergio Pereira wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-11-2006 9:09 AM
I know this is not a contest but here's what I do:
ALT+D, [right arrow], [? or &], [ENTER]
I think it works in IE and FF.
BR wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-13-2006 8:54 AM
Fritz,
1. When is your book Essential ASP.Net 2.0 scheduled to come out?
2. Also, does this book include examples in vb? I am not familiar with c#?
Thanks
br
Fritz Onion wrote re: Browser tip for generating fresh GET request after a page has been POSTed
on 08-14-2006 3:57 AM
BR - the book is scheduled to be out in November, and the samples in the book will be available online in VB (the printed text will include C# only).

The private life of Alex Thissen wrote Simple trick to do a refresh after POSTback
on 12-06-2006 11:07 AM
Just a quick trick to do a full refresh of your page after that page has had a postback. You know, that's
Alex Thissen Weblog Build 1.15.10.1971 wrote Simple trick to do a refresh after POSTback
on 12-06-2006 11:57 AM
Just a quick trick to do a full refresh of your page after that page has had a postback. You know, that's
Alex Thissen Weblog Build 1.15.10.1971 wrote Simple trick to do a refresh after POSTback
on 12-08-2006 10:13 AM
Just a quick trick to do a full refresh of your page after that page has had a postback. You know, that's

Add a Comment

(required)  
(optional)
(required)  
Remember Me?