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. problem When Refreshing a page

problem When Refreshing a page

Scheduled Pinned Locked Moved ASP.NET
helpdatabasecomquestion
2 Posts 2 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.
  • M Offline
    M Offline
    meetbinu2003
    wrote on last edited by
    #1

    Dear All, Recently i noticed a problem .Simply the problem is i two text boxes for regno and Name and a button to save . I wrote code for saving data in button Click event. That works fine. Once i saved a data and then refresh the page the data is again saving. that means when refreshing the page button click event also executing. This creats many problem in our project. so many double entries occured. How can avoid it.? (one solution is check same data is present in the database before inserting. But this is not practicably apply for my cases) Please help me.......... Urgent (if u didn't understand our problem please contact me meetbinu2003@gmail.com)

    C 1 Reply Last reply
    0
    • M meetbinu2003

      Dear All, Recently i noticed a problem .Simply the problem is i two text boxes for regno and Name and a button to save . I wrote code for saving data in button Click event. That works fine. Once i saved a data and then refresh the page the data is again saving. that means when refreshing the page button click event also executing. This creats many problem in our project. so many double entries occured. How can avoid it.? (one solution is check same data is present in the database before inserting. But this is not practicably apply for my cases) Please help me.......... Urgent (if u didn't understand our problem please contact me meetbinu2003@gmail.com)

      C Offline
      C Offline
      cloudking11966
      wrote on last edited by
      #2

      Just give Response.Redirect to the same page soon after the Insert. This problem is there for deletes also, so it is a good practice to give response.Redirect soon after the opertion, so that the viewstate is cleared.

      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