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. Disabling asp:button after submitted or pressed

Disabling asp:button after submitted or pressed

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptsysadminalgorithms
3 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.
  • T Offline
    T Offline
    tech untouchable
    wrote on last edited by
    #1

    I've been searching everywhere for a way to disable a push button as soon as it's pressed. I really don't want to have to use Javascript to do this and would rather write straight up VB.NET to handle this request. Basically you have a button: when the person clicks on that I want to disable the button, the code should do the following: pushbutton.enabled=false pushbutton.text="wait" But for some reason (server-side script, I know) .NET won't re-render this. I want to make sure NO ONE can hit a submit button twice. Anyone have a solution to this? I'm open to all suggestions. Thank you, Jordan

    T R 2 Replies Last reply
    0
    • T tech untouchable

      I've been searching everywhere for a way to disable a push button as soon as it's pressed. I really don't want to have to use Javascript to do this and would rather write straight up VB.NET to handle this request. Basically you have a button: when the person clicks on that I want to disable the button, the code should do the following: pushbutton.enabled=false pushbutton.text="wait" But for some reason (server-side script, I know) .NET won't re-render this. I want to make sure NO ONE can hit a submit button twice. Anyone have a solution to this? I'm open to all suggestions. Thank you, Jordan

      T Offline
      T Offline
      Tomas Petricek
      wrote on last edited by
      #2

      Hi, you can look at similar control here: http://www.codeproject.com/aspnet/PleaseWaitButton.asp[^]. I'm not sure if it will be usefull for you, but at least you can see how to create control with similar functionality.

      Tomáš Petříček (Microsoft C# MVP)
      www.eeeksoft.net | Asp.Net Graphical controls

      1 Reply Last reply
      0
      • T tech untouchable

        I've been searching everywhere for a way to disable a push button as soon as it's pressed. I really don't want to have to use Javascript to do this and would rather write straight up VB.NET to handle this request. Basically you have a button: when the person clicks on that I want to disable the button, the code should do the following: pushbutton.enabled=false pushbutton.text="wait" But for some reason (server-side script, I know) .NET won't re-render this. I want to make sure NO ONE can hit a submit button twice. Anyone have a solution to this? I'm open to all suggestions. Thank you, Jordan

        R Offline
        R Offline
        R Senthil Kumaran
        wrote on last edited by
        #3

        have a viewstate variable for the postback!! that is have a viewstate inside the if(!isPostBack) and have it false then if the button is pressed then make it as true and if the viewstate value is true then disable it! i hope this may work!! not tried!!;):) Loving Code, R. Senthil Kumaran

        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