Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Data inserted once again after Refreshing the browser

Data inserted once again after Refreshing the browser

Scheduled Pinned Locked Moved ASP.NET
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ashok techxygen
    wrote on last edited by
    #1

    Hi, After inserting the data I am clearing the textbox and dropdownlist. But when I press the refresh button in the browser once again the data is inserted. This happens not only for Insert but also for all are the event that happens last once again happens when browser refreshed. We are not using Ajax. Thanks,

    Ashok

    K A R 3 Replies Last reply
    0
    • A ashok techxygen

      Hi, After inserting the data I am clearing the textbox and dropdownlist. But when I press the refresh button in the browser once again the data is inserted. This happens not only for Insert but also for all are the event that happens last once again happens when browser refreshed. We are not using Ajax. Thanks,

      Ashok

      K Offline
      K Offline
      kushalrshah
      wrote on last edited by
      #2

      try by setting the enableviewstate property of the controls to false

      1 Reply Last reply
      0
      • A ashok techxygen

        Hi, After inserting the data I am clearing the textbox and dropdownlist. But when I press the refresh button in the browser once again the data is inserted. This happens not only for Insert but also for all are the event that happens last once again happens when browser refreshed. We are not using Ajax. Thanks,

        Ashok

        A Offline
        A Offline
        Anish Gopi
        wrote on last edited by
        #3

        Redirect to the same page using Response.Redirect() once you have successfully enter the data. This will prevent the refreshing in performing a postback.

        1 Reply Last reply
        0
        • A ashok techxygen

          Hi, After inserting the data I am clearing the textbox and dropdownlist. But when I press the refresh button in the browser once again the data is inserted. This happens not only for Insert but also for all are the event that happens last once again happens when browser refreshed. We are not using Ajax. Thanks,

          Ashok

          R Offline
          R Offline
          Ranjit Viswakumar
          wrote on last edited by
          #4

          One easy way to handle this is to set a session variable the first time the page is posted. You can check for the presence of this on any refresh and if it already exists, prohibit posting of any information. Ranjit Viswakumar Professional Services Specialist HostMySite.com[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups