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. Web Development
  3. ASP.NET
  4. Multiple Postback on my Page

Multiple Postback on my Page

Scheduled Pinned Locked Moved ASP.NET
help
9 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.
  • R Offline
    R Offline
    Riza Azmi
    wrote on last edited by
    #1

    Hi All Could you give me a solution for multiple postback problem. In this case, if you click a button, it seems that it is executed 2 times. Honestly, I dont know "a thing" that cause it. I just use 1 masterpage, 1 control and one page. Appreciating for your comment much. Regards Azmi Simple thiing should be simple, complex thing should be possible.

    S S 2 Replies Last reply
    0
    • R Riza Azmi

      Hi All Could you give me a solution for multiple postback problem. In this case, if you click a button, it seems that it is executed 2 times. Honestly, I dont know "a thing" that cause it. I just use 1 masterpage, 1 control and one page. Appreciating for your comment much. Regards Azmi Simple thiing should be simple, complex thing should be possible.

      S Offline
      S Offline
      Sandeep Akhare
      wrote on last edited by
      #2

      Yes it was happening with me also in my case the reason was In aspx if you see Page directive there is AutoEventWireup property which is true by default and we also had written Page_init and Page Load event decalration in it. that was in 2003 in declrations sections . IN fact in 2005 there is no need to wtite it in code behind file as it is present in designer page

      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

      R 1 Reply Last reply
      0
      • S Sandeep Akhare

        Yes it was happening with me also in my case the reason was In aspx if you see Page directive there is AutoEventWireup property which is true by default and we also had written Page_init and Page Load event decalration in it. that was in 2003 in declrations sections . IN fact in 2005 there is no need to wtite it in code behind file as it is present in designer page

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        R Offline
        R Offline
        Riza Azmi
        wrote on last edited by
        #3

        Hi Sandeep Thanks for your reply. So, what should I do? Is it delete the AutoEventWireup property or just set it into false? Btw, in my code AutoEventWireup property is set into false (in html markup sections). But, it is still create twice postback. I test it with Response.write("alert('test')"). In result, alert test is comes up twice, which means there are 2 postback. Regards, Azmi rizaazmi [at] yahoo [dot] co [dot] id ----------------------------------------------------------- Simple thing should be simple, complex thing should be opssible.

        S 1 Reply Last reply
        0
        • R Riza Azmi

          Hi All Could you give me a solution for multiple postback problem. In this case, if you click a button, it seems that it is executed 2 times. Honestly, I dont know "a thing" that cause it. I just use 1 masterpage, 1 control and one page. Appreciating for your comment much. Regards Azmi Simple thiing should be simple, complex thing should be possible.

          S Offline
          S Offline
          Sarani Ravindran
          wrote on last edited by
          #4

          Remove the "Handles button1.Click" from the button_click event. God is always with you.

          R A 2 Replies Last reply
          0
          • R Riza Azmi

            Hi Sandeep Thanks for your reply. So, what should I do? Is it delete the AutoEventWireup property or just set it into false? Btw, in my code AutoEventWireup property is set into false (in html markup sections). But, it is still create twice postback. I test it with Response.write("alert('test')"). In result, alert test is comes up twice, which means there are 2 postback. Regards, Azmi rizaazmi [at] yahoo [dot] co [dot] id ----------------------------------------------------------- Simple thing should be simple, complex thing should be opssible.

            S Offline
            S Offline
            Sandeep Akhare
            wrote on last edited by
            #5

            I can't say anything just try to check events how they are firing

            Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

            1 Reply Last reply
            0
            • S Sarani Ravindran

              Remove the "Handles button1.Click" from the button_click event. God is always with you.

              R Offline
              R Offline
              Riza Azmi
              wrote on last edited by
              #6

              Hi Saranya Devi, Hi All Thanks for the solution. By your answer, I just find the problem. The reason is there is a 2 event click: 1. in the HTML page (markup section) there is OnClick = "Button1_Click" 2. in the aspx.vb (code section) there is Handles Button1.Click So, choose one wheter delete Handles Button1.Click or remove OnClick="Button1_Click" I guess this is cause when I move 2003 to 2005. Case is closed. Thanks all for sharing the solution.

              1 Reply Last reply
              0
              • S Sarani Ravindran

                Remove the "Handles button1.Click" from the button_click event. God is always with you.

                A Offline
                A Offline
                Atif Ali Bhatti
                wrote on last edited by
                #7

                yes he is right.there is an another alternative for tht. remove onClick="button_click" from the button's html in .aspx page. Regards. Atif Ali Bhatti. Software Engineer. eSoul Consultancy Pvt. Ltd.

                R A 2 Replies Last reply
                0
                • A Atif Ali Bhatti

                  yes he is right.there is an another alternative for tht. remove onClick="button_click" from the button's html in .aspx page. Regards. Atif Ali Bhatti. Software Engineer. eSoul Consultancy Pvt. Ltd.

                  R Offline
                  R Offline
                  Riza Azmi
                  wrote on last edited by
                  #8

                  Assalamua`laikum Atif Ali Bhatti Thanks for the solution.

                  1 Reply Last reply
                  0
                  • A Atif Ali Bhatti

                    yes he is right.there is an another alternative for tht. remove onClick="button_click" from the button's html in .aspx page. Regards. Atif Ali Bhatti. Software Engineer. eSoul Consultancy Pvt. Ltd.

                    A Offline
                    A Offline
                    Atif Ali Bhatti
                    wrote on last edited by
                    #9

                    WaAlakum Assalam, every buddy here is most welcome n requested to feel free to ask n e question regarding web development is there is ne. I always would be there if i know. Regards. Atif Ali Bhatti. Software Engineer. eSoul Consultancy Pvt. Ltd.

                    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