www.webdeveloper.com
Results 1 to 8 of 8

Thread: Back button issue

  1. #1
    Join Date
    Feb 2007
    Posts
    4

    Post Back button issue

    Hi,
    I need your help to solve this problem I am facing.
    I have a ListBox with items as "Test1" and "Test2" and a label.
    When the user selects Test1 I am hiding the label and when the user selects Test2 i am making the label visible.
    Now the problem is when the user selects Test2 and Presses Back button in the browser, the selection in the listBox is still displayed as Test2 and the label is getting hidden.

    How to make the selection in the listbox change to Test1 when Browser back button is used.

    Thanks in advance
    Naveen

  2. #2
    Join Date
    Jun 2004
    Location
    Kansas City, MO
    Posts
    1,607
    Not sure if this will help but there is this piece of code you can put in your page_load event
    Code:
    If Not Page.IsPostBack Then 
        'Fires the first time page is loaded
    Else
        'Fires on each post back
    End If

  3. #3
    Join Date
    Feb 2007
    Posts
    4

    Unhappy Browser Back button issue

    I tried it before. It wont help me. It is the problem of IE caching. I want the list box selection to be reset to what it was holding previously when browser back button is used. I cant remove chaching or diable back button because I cant afford to restrict the user.

    Thank you for the suggestion and please let me know when you find the solution.

    Thanks
    Naveen

  4. #4
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Have you trying disabling viewstate for the List box?

  5. #5
    Join Date
    Feb 2007
    Posts
    4
    No I haven't. Can u elaborate?

  6. #6
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    ListBox.EnableViewState = False

  7. #7
    Join Date
    Feb 2007
    Posts
    4
    Thank you but sorry this is not the solution.
    you can create a simple app as for my description and check.
    I am struggling with this problem form 2 days.

  8. #8
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    Ah i see your problem but sorry don't have an answer for you. If i find 1 i will post. Sorry i couldn't help.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles