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 with Button Events

Problem with Button Events

Scheduled Pinned Locked Moved ASP.NET
csharphtmlvisual-studiosysadminhelp
5 Posts 3 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.
  • H Offline
    H Offline
    hasanali00
    wrote on last edited by
    #1

    Hi Sometimes, I get the following problem: I create WebForms in VS.net. I drag & drop a button on the WebForm. Then I double click it to write the event code in the code-behind file. Then I test the button event on localhost and it works. Then I deploy the project on a Live shared server. I click on the same button, and nothing happens. If I include the onclick= "Button1_Click" to the html code , then the button event works on both: localserver & live server. So please tell me why I get this problem for some Button controls and how I get solve this problem ? (As I said I dont get this problem all the time)

    M 1 Reply Last reply
    0
    • H hasanali00

      Hi Sometimes, I get the following problem: I create WebForms in VS.net. I drag & drop a button on the WebForm. Then I double click it to write the event code in the code-behind file. Then I test the button event on localhost and it works. Then I deploy the project on a Live shared server. I click on the same button, and nothing happens. If I include the onclick= "Button1_Click" to the html code , then the button event works on both: localserver & live server. So please tell me why I get this problem for some Button controls and how I get solve this problem ? (As I said I dont get this problem all the time)

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, Are sure that the code in the local dev box is the same as that in the live server? You might want to double check the web page with the button that does not work properly. From my experience, this phenomenon happens with the ASP.NET 1.x, are you using this version? So you may consider using your own code to wire up the event handlers in code-behind instead of using the generated code. Another option is to use the inline code to register the event handler like you have tried, and it's also used by default in the ASP.NET 2.0

      _ 1 Reply Last reply
      0
      • M minhpc_bk

        Hi there, Are sure that the code in the local dev box is the same as that in the live server? You might want to double check the web page with the button that does not work properly. From my experience, this phenomenon happens with the ASP.NET 1.x, are you using this version? So you may consider using your own code to wire up the event handlers in code-behind instead of using the generated code. Another option is to use the inline code to register the event handler like you have tried, and it's also used by default in the ASP.NET 2.0

        _ Offline
        _ Offline
        _AK_
        wrote on last edited by
        #3

        Hi, Is this a bug of ASP.NET 1.x? Because i too have faced the same problem sometime ago. But it got working once i removed the event handler code and again getting it by double clicking that. Best Regards, Apurva Kaushal

        M 1 Reply Last reply
        0
        • _ _AK_

          Hi, Is this a bug of ASP.NET 1.x? Because i too have faced the same problem sometime ago. But it got working once i removed the event handler code and again getting it by double clicking that. Best Regards, Apurva Kaushal

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          I'm not sure if it is actually a bug as I didn't see Microsoft claims about it or I just miss that. But they said, you might have the postback event problem, when you run your ASP.NET on multiple load-balanced servers and the .Net framework 1.1 SP1 has not been installed on all servers. Also when I found that VS 2003 sometimes deletes the auto-generated code containing the event handler registration, I managed to put it on my own.

          _ 1 Reply Last reply
          0
          • M minhpc_bk

            I'm not sure if it is actually a bug as I didn't see Microsoft claims about it or I just miss that. But they said, you might have the postback event problem, when you run your ASP.NET on multiple load-balanced servers and the .Net framework 1.1 SP1 has not been installed on all servers. Also when I found that VS 2003 sometimes deletes the auto-generated code containing the event handler registration, I managed to put it on my own.

            _ Offline
            _ Offline
            _AK_
            wrote on last edited by
            #5

            Probably because it is happening on quite rare occassions that hasn't got the much of attention. :) Best Regards, Apurva Kaushal

            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