views:

656

answers:

2

Hi,

On my machine when I test my webapplication (wether in debug or normal) after a javascript:history.back() triggers a postback in my app. On the other hand it does not occur when i precompile the application. Lastly, when I test the same pages on someones elses machine, the postback does not occur at all.

I'm using vs2008, asp.net 2.0 with AutoEventWireup="false"

I checked files with beyond compare, checked metadata.xml but I don't understand why on my local it does a postback.

what can be the problem?

+1  A: 

do it like: javascript:history.back(); return false;

eglasius
+1  A: 

On the other hand it does not occur when i precompile the application. Lastly, when I test the same pages on someones elses machine, the postback does not occur at all.

Then it's likely a cacheing issue. If IE can remember the previous page it may not have to reload it. Different deployment options lead to different cacheing headers being passed back to the browser, and different browser options may conspire to expire the cache at different points.

In general you want to be using the Post/Redirect/Get pattern to avoid postbacks, and there is almost never a good reason to use ‘history.back()’ or ‘javascript:’ URLs.

bobince