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. General Programming
  3. C#
  4. Button Event Occur when i refresh the page

Button Event Occur when i refresh the page

Scheduled Pinned Locked Moved C#
designhelp
11 Posts 5 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.
  • J Offline
    J Offline
    Jabeerbe
    wrote on last edited by
    #1

    Hi all, I have design the web site with the some Control. If i press the button then the New textbox will be created. This is Working fine.But when i refresh the page after click the button also the textbox created. Kindly help me.:cool: Regards, A Jabeer Ali.

    Regards, A Jabeer Ali

    C S 2 Replies Last reply
    0
    • J Jabeerbe

      Hi all, I have design the web site with the some Control. If i press the button then the New textbox will be created. This is Working fine.But when i refresh the page after click the button also the textbox created. Kindly help me.:cool: Regards, A Jabeer Ali.

      Regards, A Jabeer Ali

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      When you refresh, you do the postback again, thus the button press will occur again.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      M J 2 Replies Last reply
      0
      • C Christian Graus

        When you refresh, you do the postback again, thus the button press will occur again.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        M Offline
        M Offline
        Martin 0
        wrote on last edited by
        #3

        Hello Christian, Is there some kind of Application.DoEvents() call, responsible for that? All the best, Martin

        J 1 Reply Last reply
        0
        • C Christian Graus

          When you refresh, you do the postback again, thus the button press will occur again.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          J Offline
          J Offline
          Jabeerbe
          wrote on last edited by
          #4

          The Button Press Should not happen when the user hits the refresh Button.

          Regards, A Jabeer Ali

          J P 2 Replies Last reply
          0
          • M Martin 0

            Hello Christian, Is there some kind of Application.DoEvents() call, responsible for that? All the best, Martin

            J Offline
            J Offline
            Jabeerbe
            wrote on last edited by
            #5

            From my knowlegde There is no such function available. Please tell me some solution to refresh the Button event to happen.

            Regards, A Jabeer Ali

            1 Reply Last reply
            0
            • J Jabeerbe

              The Button Press Should not happen when the user hits the refresh Button.

              Regards, A Jabeer Ali

              J Offline
              J Offline
              Jabeerbe
              wrote on last edited by
              #6

              When i change the method of the Form to "POST". Then if i refresh the Page is asking me confirmation Dialog. If i press ok then the Textbox is Created else not. But i need even that should not be happen.

              Regards, A Jabeer Ali

              1 Reply Last reply
              0
              • J Jabeerbe

                The Button Press Should not happen when the user hits the refresh Button.

                Regards, A Jabeer Ali

                P Offline
                P Offline
                Pete OHanlon
                wrote on last edited by
                #7

                This happens because you are refreshing the last operation - which was the javascript doPostback operation. If you don't want this to happen, I would suggest that you change the architecture so you don't need the postback to happen.

                Deja View - the feeling that you've seen this post before.

                J 1 Reply Last reply
                0
                • P Pete OHanlon

                  This happens because you are refreshing the last operation - which was the javascript doPostback operation. If you don't want this to happen, I would suggest that you change the architecture so you don't need the postback to happen.

                  Deja View - the feeling that you've seen this post before.

                  J Offline
                  J Offline
                  Jabeerbe
                  wrote on last edited by
                  #8

                  Can you Help me in changing the Architecture

                  Regards, A Jabeer Ali

                  P 1 Reply Last reply
                  0
                  • J Jabeerbe

                    Hi all, I have design the web site with the some Control. If i press the button then the New textbox will be created. This is Working fine.But when i refresh the page after click the button also the textbox created. Kindly help me.:cool: Regards, A Jabeer Ali.

                    Regards, A Jabeer Ali

                    S Offline
                    S Offline
                    srirammails
                    wrote on last edited by
                    #9

                    use if not Page.postback

                    J 1 Reply Last reply
                    0
                    • S srirammails

                      use if not Page.postback

                      J Offline
                      J Offline
                      Jabeerbe
                      wrote on last edited by
                      #10

                      There is such option available. U mean to say Ispostback Option. If i give the Ispostback option. When the page refresh that will also run.

                      Regards, A Jabeer Ali

                      1 Reply Last reply
                      0
                      • J Jabeerbe

                        Can you Help me in changing the Architecture

                        Regards, A Jabeer Ali

                        P Offline
                        P Offline
                        Pete OHanlon
                        wrote on last edited by
                        #11

                        Well, you may want to look into Ajax. This doesn't use postbacks.

                        Deja View - the feeling that you've seen this post before.

                        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