.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Prevent double-click on button control

Posted By:      Posted Date: October 20, 2010    Points: 0   Category :ASP.Net


I've read several posts on this subject, but most solutions refer to using http://www.metabuilders.com/Tools/OneClick.aspx or to using javascript to disable the button (after the first click).  Both of these solutions would work, but I was hoping for some basic server code that uses the standard button control, and that I could re-use on various forms to prevent double-clicks.  Or if there are any good articles or suggestions on this that you could direct me to view I would appreciate it.  Thanks for your help!

View Complete Post

More Related Resource Links

Handling Ctrl + Shift + Click on Button control

Hi All, I have to Button control in my Windows form. I have to handle 2 types of click events on this button. 1. Ctrl + Shift + Click //Allow the user to do some special task. 2. Click //Allow the user to perform normal task only. How could I handle Ctrl + Shift + Click ? Please help me out.

How to prevent combobox drop down from expanding on double click

Hi, I have a requirment to toggle the selected item of a combobox on double click. I am able to achieve this using MouseDoubleClick event for combobox. But the issue is, when I double click the popup for the combobox also drops down, which I need to avoid.   How can I do this.   Please help.   Thanks, P

Multiple instance of User Control on Page - Button Click Event

Hi, I have this Web User Control, with 3 controls:<asp:TextBox ID="txtSearch" runat="server" /> <asp:RequiredFieldValidator ID="rfvSearch" runat="server" ControlToValidate="txtSearch" Display="None" /> <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" /> In code behind: protected override void Render(HtmlTextWriter writer) { rfvSearch.ValidationGroup = this.ID + "_validation"; txtSearch.ValidationGroup = this.ID + "_validation"; btnSearch.ValidationGroup = this.ID + "_validation"; base.Render(writer); } protected void btnSearch_Click(object sender, EventArgs e) { Response.Redirect("ResultadoSearch.aspx?argumento=" + txtSearch.Text); } When I try to add two UserControl and I Click in btnSearch of second UserControl, txtSearch.txt returns value of first User control.How I can get the value of second txtSearch?

dynamically created button control click event not firing first time?

HI im creating a button control in page int and im assing a click event for the button control. here the click event is not firing for the first time.can anyone help me with this? here is my code. Button btn = new Button(); btn.ID = "btn"; btn.Click += new EventHandler(btn_Click); Panel1.Controls.Add(btn); Panel1.Controls.Add(new LiteralControl(""));

Gridview Link Button control click event


Respected Reader,

I have  Web page that uses LinkButton control inside Template Fields of Gridview.

I am trying to work on LinkButton Click event and trying to preserve the Value of LinkButton that user click, and based on that value, i want to refresh tha page data.

I used CommandName and CommandArgument property of Linkbutton, but i can use that property only in GridView_RowCommand method by checking e.CommandName expression. But the problem with that Gridview_RowCommand event fire after all other page_load activity. So the value never used in the page_load event to refresh the data in all other control.

I also tried to use OnClick Method, Session variable and Hidden variable. but when i run Response.Redirect method from Gridview_RowCommand, it clear all the Session and Hidden variable values. also tried (Response.Redirect(,false)) method but never got success.

Any suggestion will be appricated in advance.

Prevent double click


 G'day All,

     This is my first post, and I am new to programming. I have created a website written in ASP.NET (4.0) with VB.NET (10.0) as the code-behind. I have created a game that plays Aton, the boardgame, via the web. I have created a board with multiple imagebuttons and standard buttons that are enabled for the user to click as the logic demands. My problem is : I need to be able to disable all of the imagebuttons/standard buttons after the user has made a selection (ie clicked on anything available). Essentially this is double click problem that has been discussed in the past. Up to this point, I have been able to use javascript to disable a single button (which works well), but I dont know how to disable the lot !

     I have searched far and wide, but have not been able to find a solution that works with the modern versions of ASP/VB. I have a grid of over 50 imagebuttons/standard buttons that all require disabling after any selection. Any solution would work for me, ie freeze screen, overlay image or individual button disabling. My instinct tells me that a large overlay would be the best, but I would like it work in all of the modern day browsers (Firefox, IE, Safari, Crome and Opera)


Add a button to update in 1 click to a gridview control


Hi all, I know that from the title probably everyone is going to think, "why add an update if is already there!"  the reason is because I want to update/delete/add with one click, instead of click the edit button, modify the data and then click the update button.

This is my scenario, I have a gridview with information of tools(screw driver, hammer, etc) one of the columns is the status, so what I want is to add a button that the user can click and chance the status from "Assigned" to "Active" this is what I have so far:

<asp:GridView ID="GV1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                        DataKeyNames="IdTool" DataSourceID="Tool" ForeColor="#333333" SelectedRowStyle-BackColor="AliceBlue"
                        SelectedRowStyle-Font-Bold="true" Width="605px">
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                            <asp:TemplateField ShowHeader="False">

Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page


how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services


Thanks in advance

Button click in master page use in other pages I have to click twice. Why?


In my masterpage I have a menu with buttons. I want the buttons to do something after click. It works but I have to click twice on the button, why? What do I have to do to just to click once?

on click event for my control


hi ,

I have a project that when I add for example a button control I can not achieve click event ,

I can do add click event but when I add breakpoint I can not sense any response .... is there any probelem witg vs2010 ?

Infopath button click event in custom workflow code.


Hi All,

I have designed the infopath form(Init) and integrated with my state machine workflow. i want to access button click event (designed in Infopath form) in my workflow code.

Can you help me.




Object expected error


<input type="button' onclick="timeoutCheck()" value="Click Me!" />

it tells me Microsoft JScript runtime error: Object expected


timeoutCheck() is my script function that i declared above the input tag

can anyone tell me why i am getting this error

hello i need help , any ideas are welcome i have been working on this for two weeks now and cannot seem to be able to advance

Catch button click event in different .aspx page.


I have a button which starts processing.
I want that when ever a button is click from page1.aspx .. a count down timer should start and displayed on page2.aspx.
I am thinking of using iframe to join 2 pages.

Please let me know your suggestions.


Infopath form using Visual Studio - How to bind repeating table on submit button click ?


Hello friends,

   I have created infopath form using Visual Studio 2008

Form have 3 dropdowns and one repeating table which is bound by Datasource ( List from sharepoint ).

whenever i select appropritae values from drop down, Repeating table gets bound as datasource for dropdown and repeating table are same.

I have done conditional formating for repeating table using repeating table properties.


My Question:


Now i included one submit button and i want when i click submit button it will check DropDown Values and if appropriate record matching these values found it will fill repeating table

How i achive this ? as i dont find how to bind repeating table on submit button.

Please help if anyone have answer.


Thanks and Regards,


Kapil Bhosale.




ReportViewer Calendar button Click does not show calendar


I have a reportviewer on a page which is grabbing a report from a report server. the page is basically just a dropdownlist and a reportviewer control. The problem I have is that in the report the user have to provide the dates for teh report. The reportviewer automatically adds the textbox for the date entry and a calendar icon in front of it so the user can select the date. if I look at this page  in FireFox, when you click on the calendar button created by the reportviewer, the calendar control show up momentrily and dispappears. If you look at the same page in IE 7.0 nothing happens other than the page appears to be submitted. Does any body have any ideas on how to go about troubleshooting this bug?



click a button to print current window form

how can i click a button to print current window form? i don't know how to set and define something? anyone give me example for my reference   thanks.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend