Link to home
Start Free TrialLog in
Avatar of seckel
seckel

asked on

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

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.

Problem:
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...
ASKER CERTIFIED SOLUTION
Avatar of gadget27
gadget27

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of seckel
seckel

ASKER

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)

    Response.Cache.SetNoStore()
            
    If Not Page.IsPostBack Then    
        BindData()
    End If
      
  End Sub
Avatar of seckel

ASKER

gadget27-

I got your suggestion to work.  Thanks a lot!
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?