Problem with listbox retaining selection after iExplore Back button is clicked.

Posted on 2004-11-23
Last Modified: 2008-02-01
I have an ASP.NET search page with two listboxes and a refresh button.

When listbox #2 is selected, it then redirects to the #2 content page.

If the user hits the iExplore Back button, the search page is shown with selected item highlighted in listbox #2.

When the user then attempts to select an item from listbox #1 or click on the refresh button, it still redirects to the #2 content page. It's like the page retains the listbox #2 selection.  

How I clear the select of listbox #2 when the user hits the Back button from the #2 content page?

Please show solution using VB.NET...
Question by:seckel
    LVL 3

    Accepted Solution

    Add this line to your Page_Load:


    You'll see after that, if a user 'Backs' into a previous page, the listbox controls will all be unselected.

    Author Comment

    gadget27 - Does it matter where it goes in Page_Load?

    I tried what you suggested, but it did not work.  Still same problem...

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)

        If Not Page.IsPostBack Then    
        End If
      End Sub

    Author Comment


    I got your suggestion to work.  Thanks a lot!
    LVL 3

    Expert Comment

    Right at the head of Page_Load should be fine, as you have done. If there are other postback events on that page other than the clicking of a button which causes a redirect, that may cause this not to work. Along with the line you just added, try adding SmartNavigation="True" to the @Page Directive in your .ASPX page. If that doesn't do it for you, would you post your code to this page so that I can look at it in more detail?

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now