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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Page Refresh Problem --- Postback Gurus Help

Page Refresh Problem --- Postback Gurus Help

Scheduled Pinned Locked Moved C#
helptutorialquestion
4 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.
  • F Offline
    F Offline
    fahiemulleh
    wrote on last edited by
    #1

    Hi all. Please see the following scenario. I have a textbox on my page with ADD button. when i enter some text in textbox and Click ADD, the text will be added in my gridview. so far, so good. Now, If i refresh the page, that record has been inserted again and Gridview will now show two similar records. Please tell me how to deal with it ? whether i have to keep check on textbox or what else ?

    E 1 Reply Last reply
    0
    • F fahiemulleh

      Hi all. Please see the following scenario. I have a textbox on my page with ADD button. when i enter some text in textbox and Click ADD, the text will be added in my gridview. so far, so good. Now, If i refresh the page, that record has been inserted again and Gridview will now show two similar records. Please tell me how to deal with it ? whether i have to keep check on textbox or what else ?

      E Offline
      E Offline
      ednrgc
      wrote on last edited by
      #2

      What are you doing in your page load or page init events?

      F 1 Reply Last reply
      0
      • E ednrgc

        What are you doing in your page load or page init events?

        F Offline
        F Offline
        fahiemulleh
        wrote on last edited by
        #3

        in page load, i have write: if (isPostBack == true) { if (txtValue.Text == "") { // Do Nothing } } The paging size of my grid is set to 3. When i INSERT Record for first time, it shows only one record and on the page refresh, it doesnt insert record again. However, when i insert record for the second time, it insert record on page refresh again. Please tell me how to solve it.

        E 1 Reply Last reply
        0
        • F fahiemulleh

          in page load, i have write: if (isPostBack == true) { if (txtValue.Text == "") { // Do Nothing } } The paging size of my grid is set to 3. When i INSERT Record for first time, it shows only one record and on the page refresh, it doesnt insert record again. However, when i insert record for the second time, it insert record on page refresh again. Please tell me how to solve it.

          E Offline
          E Offline
          ednrgc
          wrote on last edited by
          #4

          First, there is no reason to qualify a boolean value. if (Page.IsPostBack) will work fine. But that's not your problem. What's in the click event code?

          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