I have this DropDownList inside a DataList.
<asp:DropDownList runat="server" ID="DDL_ProdCat" OnSelectedIndexChanged="DDL_ProdCat_SelectedIndexChanged"
Autopostback="true" DataTextField="Name" DataValueField="ID" />
When the user makes a selection in this DropDownList, for some selections, they are redirected to a separate page.
After being redirected, the user hits their browser-back button, they are returned to this page with the DropDownList.
Unfortunately, the selection which redirected them to the new page is still selected.
Example
Is there a way to reset the DropDownList selection to a particular value when the user revisits the page via the browser-back button?
Note
If it is OK to remove page-level browser-caching, you can try to remove the cache so that it reloads the page when the user goes back. Add this to page load:
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With