Thomas’ Developer Blog

October 16, 2008

Handling form data issues with FireFox on page refresh

Filed under: Asp.Net Framework 2.0, Browsers, javascript, vb.net — Tags: , , — sanzon @ 9:08 am

If you have ever noticed how FireFox maintains form data on a page refresh, it can causes some issues at times when handling .net code that uses these inputs to render javascript code after the page loads.

To get around this, you can simply use the following code with a scriptmanager control:

If Not Page.IsPostBack Then 
   ScriptManager.RegisterStartupScript(Page, Page.GetType(), _
   "ScriptManager_myFunction", "document.getElementById('" & _
   myControl.ClientID & "').value = 'default value';", True)
End If

You can also clear the form control value, but I typically do not recommend this action since it defeats the advantages associated with firefox maintaining form data on refresh.

Advertisements

30 Comments »

  1. Bonjourno dear friends! I was reading for a while and now i’m registered:)
    Hope i’m welcome here)

    Comment by Amegreenini — February 10, 2009 @ 10:32 pm

  2. naturally like your web site but you need to test the spelling on several of your posts.

    A number of them are rife with spelling issues and I in finding it very bothersome to tell the truth then again I will surely come back again.

    Comment by how to configure best comcast dsl best modem for xbox live — July 22, 2014 @ 8:21 pm

  3. Wow that was strange. I just wrote an really long comment but after I clicked submit my comment didn’t appear.
    Grrrr… well I’m not writing all that over again.
    Anyways, just wanted to say excellent blog!

    Comment by how to configure best best docsis 3 best docsis 3 cable modem — August 5, 2014 @ 5:52 pm

  4. It’s in fact very difficult in this active life to listen news on TV, thus I only use internet for that reason, and obtain the most recent information.

    Comment by how to configure best cable the best modem for xbox — August 7, 2014 @ 8:50 pm

  5. Hi there! I know this is kinda off topic however , I’d figured I’d ask.

    Would you be interested in trading links or maybe guest writing a blog post or
    vice-versa? My website discusses a lot of the
    same topics as yours and I think we could greatly benefit
    from each other. If you might be interested feel free to
    shoot me an email. I look forward to hearing from you!
    Superb blog by the way!

    Comment by how to configure best buy motorola cable modem for — August 12, 2014 @ 10:03 pm

  6. It’s amazing to visit this web site and reading the views of all colleagues concerning this post, while I
    am also keen of getting experience.

    Comment by how to configure best buy best wireless modem for comcast — August 23, 2014 @ 11:24 pm

  7. Heya just wanted to give you a quick heads up and let you know a few of the
    pictures aren’t loading properly. I’m not sure why but I think
    its a linking issue. I’ve tried it in two different internet
    browsers and both show the same results.

    Comment by how to configure best cable do you need a modem for — September 1, 2014 @ 7:39 pm

  8. Great post. I was checking continuously this blog and I am impressed!
    Extremely useful info specifically the last part :) I care for
    such information a lot. I was seeking this particular info for a long time.
    Thank you and best of luck.

    Comment by how to configure best cable the whats the best modem — September 1, 2014 @ 10:43 pm

  9. You ought to take part in a contest for one of the best blogs online.

    I am going to recommend this website!

    Comment by how to configure best best docsis 3 arris cable modem for comcast — September 2, 2014 @ 5:22 am

  10. I think the admin of this web page is actually working hard
    in support of his web page, because here every material
    is quality based data.

    Comment by how to configure best cable best best cable modem for — September 3, 2014 @ 7:43 am

  11. I believe this is among the most important info for me.
    And i am happy reading your article. However want to commentary on few general issues, The website taste is great, the articles
    is truly excellent : D. Excellent task, cheers

    Comment by how to configure best best docsis 3 best cable modem for comcast — September 3, 2014 @ 1:29 pm

  12. I do not even understand how I stopped up right here, however I thought this put up was great.
    I do not understand who you are however certainly you are going to a well-known blogger
    when you aren’t already. Cheers!

    Comment by how to configure best cable best best modem for xbox live — September 8, 2014 @ 4:31 am

  13. Hello it’s me, I am also visiting this site on a regular basis, this site is in fact good and the people are really
    sharing nice thoughts.

    Comment by how to configure best arris tg862g \/ct arris tg862g\/ct — September 11, 2014 @ 6:04 am

  14. Thank you a bunch for sharing this with all people you really know what you’re
    speaking about! Bookmarked. Kindly additionally visit my website =).

    We will have a link change agreement between us

    Comment by how to setup billion modem — September 17, 2014 @ 3:35 am

  15. Hi there it’s me, I am also visiting this site
    on a regular basis, this site is actually nice and the users are truly sharing fastidious thoughts.

    Comment by how to configure streamyx billion modem — September 18, 2014 @ 5:35 pm

  16. Attractive component to content. I just stumbled upon your site and
    in accession capital to claim that I get in fact enjoyed account your weblog posts.
    Any way I will be subscribing to your feeds or even I achievement you access
    constantly rapidly.

    Comment by how to configure best best wireless cable modem for comcast internet — September 19, 2014 @ 4:10 pm

  17. Thanks for another fantastic post. The place else could
    anyone get that type of information in such a perfect means of writing?
    I have a presentation subsequent week, and I am on the search for such information.

    Comment by how to configure adsl adsl adsl modem for bsnl — September 20, 2014 @ 8:13 am

  18. Excellent way of telling, and fastidious paragraph to obtain data
    regarding my presentation focus, which i am going to convey in institution of
    higher education.

    Comment by how to configure best cable best dsl modem for xbox live — September 20, 2014 @ 9:41 am

  19. Great beat ! I wish to apprentice while you amend your
    web site, how could i subscribe for a blog web site? The account helped me a acceptable deal.
    I had been tiny bit acquainted of this your broadcast offered bright
    clear idea

    Comment by how to configure best best comcast best dsl modem for xbox — September 20, 2014 @ 9:59 am

  20. Oh my goodness! Incredible article dude! Thank you, However I am encountering issues with your RSS.

    I don’t understand why I cannot join it. Is there anyone else getting similar RSS problems?
    Anyone that knows the solution will you kindly respond?
    Thanx!!

    Comment by how to configure best best buy modem for comcast internet — September 21, 2014 @ 3:04 pm

  21. You really make it seem so easy with your presentation but I find this matter to be actually something which I
    think I would never understand. It seems too complicated and extremely broad for
    me. I am looking forward for your next post, I’ll try to get the
    hang of it!

    Comment by how to configure best best best docsis 3 cable modem — September 21, 2014 @ 3:35 pm

  22. It’s fantastic that you are getting ideas from this article as well as from our discussion made here.

    Comment by how to configure best cable how to configure modem linux — September 23, 2014 @ 3:35 am

  23. You really make it seem really easy with your presentation but I to find this matter to be really one thing that I feel I’d by no means understand.

    It kind of feels too complicated and extremely large for me.
    I’m having a look ahead on your next put up,
    I’ll try to get the cling of it!

    Comment by how to configure best comcast best cable modem for xbox — September 23, 2014 @ 1:04 pm

  24. Currently it sounds like Drupal is the preferred blogging platform available right now.
    (from what I’ve read) Is that what you are
    using on your blog?

    Comment by how to configure best cable the what is the best modem — September 23, 2014 @ 11:06 pm

  25. Oh my goodness! Incredible article dude! Thanks, However I am having difficulties with your RSS.
    I don’t know the reason why I cannot join it.
    Is there anybody getting the same RSS problems?
    Anyone who knows the answer will you kindly respond?
    Thanks!!

    Comment by how to configure best cable the whats the best modem — September 24, 2014 @ 11:52 pm

  26. No matter if some one searches for his required thing, so he/she wants to be available that in detail, so that thing is maintained over here.

    Comment by how to configure best best dsl how to connect xbox 360 — September 25, 2014 @ 9:55 am

  27. Whats up very nice website!! Guy .. Beautiful .. Wonderful ..

    I’ll bookmark your site and take the feeds additionally?
    I’m satisfied to find numerous useful information right here within the put up, we want work out more strategies in this regard, thank you
    for sharing. . . . . .

    Comment by how to configure best buying a cable modem for comcast internet — September 25, 2014 @ 10:06 am

  28. Thank you for another informative web site. The place else may
    just I get that kind of information written in such a perfect way?
    I have a project that I am simply now operating on, and
    I’ve been at the glance out for such information.

    Comment by how to configure best comcast best cable modem for charter — September 28, 2014 @ 9:52 pm

  29. It’s really a nice and useful piece of info. I’m satisfied that you shared this useful
    info with us. Please keep us up to date like this. Thank you for sharing.

    Comment by how to configure best motorola cable modem for comcast — September 30, 2014 @ 9:15 pm

  30. I like the helpful info you provide in your articles.

    I will bookmark your weblog and check again here regularly.

    I am quite sure I’ll learn a lot of new stuff right here!
    Good luck for the next!

    Comment by how to configure adsl adsl modem for bsnl — October 1, 2014 @ 11:03 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: