Results 1 to 7 of 7

Thread: IE better than FireFox???

  1. #1

    Thread Starter
    Lively Member lekhuyen's Avatar
    Join Date
    May 2006
    Posts
    80

    Question IE better than FireFox???

    In my project, I have a text box and a button. when button is clicked (text of TextBox is "Unbelievable"), Page will be direct to "abc.aspx".
    But the problem is text box.
    I standing at abc.aspx and press Back button of browser.
    If the browser is IE, text of TextBox is "Unbelievable".
    If the browser is FF, text of TextBox is "".

    I don't know what is happening in my web page.
    Thank you for any help.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: IE better than FireFox???

    So you're saying when you click the button, the text of the textbox is set to 'unbelievable' and within the same event, you redirect to another page?

    First of all, I can see no conceivable reason as to why you would want to do that: populate a textbox and then redirect. Why even populate it?

    Second, this is happening because firefox is reloading the page from the server, while IE is giving you the cached version of the page.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: IE better than FireFox???

    If you leave out the value attribute on the textbox Firefox does not reset it when loading the cached version.


    Edit: Oh yeah, and nice dramatic attention-grabbing thread title. Worked well

  4. #4

    Thread Starter
    Lively Member lekhuyen's Avatar
    Join Date
    May 2006
    Posts
    80

    Re: IE better than FireFox???

    Quote Originally Posted by mendhak
    So you're saying when you click the button, the text of the textbox is set to 'unbelievable' and within the same event, you redirect to another page?

    First of all, I can see no conceivable reason as to why you would want to do that: populate a textbox and then redirect. Why even populate it?

    Second, this is happening because firefox is reloading the page from the server, while IE is giving you the cached version of the page.
    Hi mendhak,

    At first, I apolozise about my Question. When I click the button, textbox isn't set to 'unbelievable', It was set before I click the button.

    I've try a new way to understand more about FF and IE.

    Now, I have two textbox. One shows the Name (txtName), one shows the FName (txtFName). When value of Name is changed, value of txtFName is changed too. When i click the button, the Page will go to abc.aspx. Then, I click Back button on standard buttons in abc.aspx, page returns back.
    But with IE: the values of txtFName, txtName are stored.
    With FF: the value of txtFName is stored but value of txtName is not.
    In my code behind, I reset value of txtFName = "" before I go to next page.
    And i want values of txtFName, txtName are stored or not stored, not one of them is stored.
    So, What should i do now?

  5. #5
    Addicted Member rabid lemming's Avatar
    Join Date
    Feb 2005
    Posts
    210

    Smile Re: IE better than FireFox???

    To keep the values use Cache code to put the values back ionto the page text box's:

    http://aspnet.4guysfromrolla.com/articles/100902-1.aspx

    To stop the catch from doing this try clearing rthe browser catch with asp with:

    <% Response.CacheControl = "no-cache" %>
    <% Response.AddHeader "Pragma", "no-cache" %>
    <% Response.Expires = -1 %>

    Not sure if that code works any more but may do

    I will wait for death with a smile and a big stick

  6. #6

    Thread Starter
    Lively Member lekhuyen's Avatar
    Join Date
    May 2006
    Posts
    80

    Re: IE better than FireFox???

    Quote Originally Posted by rabid lemming
    To keep the values use Cache code to put the values back ionto the page text box's:

    http://aspnet.4guysfromrolla.com/articles/100902-1.aspx

    To stop the catch from doing this try clearing rthe browser catch with asp with:

    <% Response.CacheControl = "no-cache" %>
    <% Response.AddHeader "Pragma", "no-cache" %>
    <% Response.Expires = -1 %>

    Not sure if that code works any more but may do
    I had tried your code. but It don't have any thing better.

  7. #7
    Addicted Member rabid lemming's Avatar
    Join Date
    Feb 2005
    Posts
    210

    Cool Re: IE better than FireFox???

    Ok then try this maybe:

    Code:
     Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            ' check page isn't been post back from form event procedures
            ' Might need to be "If Page.IsPostBack Then" as can't be sure which one you need
            If Not Page.IsPostBack Then
            'Add code to empty the text box's i.e.
           MyTextBox.text = ""
           End if
     end sub
    Might that work ? Or you could just have

    Code:
     Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
            'Add code to empty the text box's i.e.
           MyTextBox.text = ""
    end sub
    That would clear the text box's every time but would cause problems with from post back events as the text box's would loose their data but you can work around that by adding it back in with catch code

    Hope this helps a bit ?

    I will wait for death with a smile and a big stick

Posting Permissions

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



Click Here to Expand Forum to Full Width