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. Avoiding Button Double Click - AJAX

Avoiding Button Double Click - AJAX

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminhelp
4 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.
  • K Offline
    K Offline
    Karan_TN
    wrote on last edited by
    #1

    currently i m using asp.net 2005 with c# (framework 2.0). i want to restrict the user to click the save button twice or more than that. Using ajax, i implemented it

    <ajaxToolkit:AnimationExtender ID="Anibtnsave" runat="server" TargetControlID="btnsave">
    <Animations>
    <OnClick>
    <EnableAction Enabled="false" /></OnClick>
    </Animations>
    </ajaxToolkit:AnimationExtender>

    the above block will disable the button. its working fine. but i used few validation controls (ajaxToolkit:ValidatorCalloutExtender). when i click the button the validation pop-ups and also button getting disable. please help me. - KARAN

    S 1 Reply Last reply
    0
    • K Karan_TN

      currently i m using asp.net 2005 with c# (framework 2.0). i want to restrict the user to click the save button twice or more than that. Using ajax, i implemented it

      <ajaxToolkit:AnimationExtender ID="Anibtnsave" runat="server" TargetControlID="btnsave">
      <Animations>
      <OnClick>
      <EnableAction Enabled="false" /></OnClick>
      </Animations>
      </ajaxToolkit:AnimationExtender>

      the above block will disable the button. its working fine. but i used few validation controls (ajaxToolkit:ValidatorCalloutExtender). when i click the button the validation pop-ups and also button getting disable. please help me. - KARAN

      S Offline
      S Offline
      saini arun
      wrote on last edited by
      #2

      Try this: private void checkButtonDoubleClick(Button button) { System.Text.StringBuilder sbValid = new System.Text.StringBuilder(); sbValid.Append("if (typeof(Page_ClientValidate) == 'function') { "); sbValid.Append("if (Page_ClientValidate() == false) { return false; }} "); sbValid.Append("this.value = 'Please wait...';"); sbValid.Append("this.disabled = true;"); sbValid.Append(this.Page.ClientScript.GetPostBackEventReference(button, "")); sbValid.Append(";"); button.Attributes.Add("onclick", sbValid.ToString()); } Copied from here http://forums.asp.net/t/1362149.aspx[^]

      M K 2 Replies Last reply
      0
      • S saini arun

        Try this: private void checkButtonDoubleClick(Button button) { System.Text.StringBuilder sbValid = new System.Text.StringBuilder(); sbValid.Append("if (typeof(Page_ClientValidate) == 'function') { "); sbValid.Append("if (Page_ClientValidate() == false) { return false; }} "); sbValid.Append("this.value = 'Please wait...';"); sbValid.Append("this.disabled = true;"); sbValid.Append(this.Page.ClientScript.GetPostBackEventReference(button, "")); sbValid.Append(";"); button.Attributes.Add("onclick", sbValid.ToString()); } Copied from here http://forums.asp.net/t/1362149.aspx[^]

        M Offline
        M Offline
        michaelschmitt
        wrote on last edited by
        #3

        Nice ideas in this thread. I like.

        1 Reply Last reply
        0
        • S saini arun

          Try this: private void checkButtonDoubleClick(Button button) { System.Text.StringBuilder sbValid = new System.Text.StringBuilder(); sbValid.Append("if (typeof(Page_ClientValidate) == 'function') { "); sbValid.Append("if (Page_ClientValidate() == false) { return false; }} "); sbValid.Append("this.value = 'Please wait...';"); sbValid.Append("this.disabled = true;"); sbValid.Append(this.Page.ClientScript.GetPostBackEventReference(button, "")); sbValid.Append(";"); button.Attributes.Add("onclick", sbValid.ToString()); } Copied from here http://forums.asp.net/t/1362149.aspx[^]

          K Offline
          K Offline
          Karan_TN
          wrote on last edited by
          #4

          great arun. thanks a lot. also the same i would like to apply for an dropdownlist. because according to the selection of dropdown value, i m changing the button textvalue. according to the text value i m calling different functions.so when user select the dropdownlist item, it take some time. during that time, user should not click the button obviously. so i want to disable the button while user selecting item from dropdownlist until the text changes. how to achieve it? help me - KARAN

          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