Dropdownlist retaining the value

cimscims
cimscims used Ask the Experts™
on
I have a dropdownlist with values and a default value as 'Select' which has selectedIndex '0'
When a value is slected from the dropdown, the user will be navigated to another screen.

Problem is when the user click on the Browser back button, the dropdown should not retain the previous value instead i need to reload with the dropdownlist with the default value 'select' as the first option.

Need help. Thanks in advance.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Consultant Software Engineer - .NET Architect
Commented:
Hi,
Please follow the link:
http://forums.asp.net/t/1304752.aspx/1?how+to+refresh+page+when+hitting+back+button
http://www.velocityreviews.com/forums/t84725-automatic-refresh-when-users-selects-back-button-in-internet-explorer.html

alternatively you can right javascript at end of page to force the dropdownlist to make default value selected if not selected.

Thanks

Author

Commented:
It worked with the below code. Thank You.

protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Response.Buffer = true;
                Response.CacheControl = "no-cache";
                Response.AddHeader("Pragma", "no-cache");
            }
        }
Imran Javed ZiaConsultant Software Engineer - .NET Architect

Commented:
You are most Welcome

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial