I have a dropdownlist like this
<asp:dropdownlist runat="server" autopostback="true" onselecteditemindexchanged="fire_event" ID="DDL"/>
and on codebehind i m doing this
page_load : if(!page.postback)I m binding data into dropdownlist
fire_event: I am redirecting page to itemselected value.
So I am able to do most of the part everything is working perfectly except..
when i select item in dropdown it redirects me to the page I wanted..but when i click back it remains at the same item selected value .I want it to be like that it loads again when i click back for e.g.
if my dropdown is like state A
and other items
A
B
C
D
when I select D it takes me to page D and when i click back
it is at state D i want it to show A instead of D
When you use the back button on many(though not necessarily all) browsers you are not hitting the server, you are retrieving a copy of the page that has been cached by the browser in it’s last state.
To avoid this you will need to prevent your page from being cached so that it is retrieved from the server instead. Adding the following to your page load will certainly do the trick in IE. Further investigation has revealed that this can also be achieved in Firefox using the no-store attribute: