?
Solved

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

Posted on 2004-11-23
4
Medium Priority
?
326 Views
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.

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...
0
Comment
Question by:seckel
  • 2
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
gadget27 earned 2000 total points
ID: 12658598
Add this line to your Page_Load:

Response.Cache.SetNoStore()

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

Author Comment

by:seckel
ID: 12658716
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
0
 

Author Comment

by:seckel
ID: 12658828
gadget27-

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

Expert Comment

by:gadget27
ID: 12658845
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?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

809 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