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

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

Sequential firing of button clicks

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :.NET Framework
Hello all, I am faced with a tricky scenario. My application is in .NET 3.5 using C# as the development language. My page is having a number of User controls, each with a Save button of its own. Now my Page containing the User Controls also has a button named SAVE. Now all these User Controls are dynamically populated in the page with respect to some events and all of them are inside individual Update Panels. Now my requirement is ONCLICK of the SAVE button in the page, the clicks of the SAVE buttons of the user controls will get fired. But since its an asynchronous call, it will be a heavy overload if all the clicks get fired simultaneously. So I thought of having sequential clicks done, i.e., after the successful completion of the Click of User Control 1, the click of User Control 2 will get fired and so on. I presume this can be done with Server Callback, but I am at a loss how to proceed with it. It would be helpful if anyone can provide me with a solution at the earliest.   Thanks in advance   Sanjoy

View Complete Post

More Related Resource Links

Access denied when user clicks refresh BDC column button

Access denied occurs with any non Site Collection Administrator regardless of rights.  It only occurs in this site collections, others they are able to refresh.  In this particular collection they can add a BDC column to a list, edit an item and place/resolve a value in the bdc col; but when they refresh they are given an acess denied.  Any thoughts on what they need read access to?  This goes away if I give site admin privs (dont want to do that) or give them read only access on the web application (dont want to do that either).

Control this objectdatasource programatically from the code behind based on different button clicks

I have a page where you can search and display other data, very simple layout. 1 Gridview and 1 objectdatasource. But i have 4 possible buttons that can populate the gridview.. i would like to control my objectdatasource from the code behind based on the button you click. here is what i have right now.. but if possible, can this source not be hardcoded like this and only built in the code behind? <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="SelectDVRInfo" TypeName="DataAccessCode"> <SelectParameters> <asp:ControlParameter ControlID="ddlDVR" Name="dvrInfo" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:ObjectDataSource> I found this site with a solution to this persons issue, but i cant seem to get mine working this way. http://stackoverflow.com/questions/2404264/overwriting-controlparameters-of-datasources-in-code-behind I have  this as the code behind right now when you press the button.. what other parameter settings am i missing and is this the right order to populate them for the source to acknowledge my values?   ObjectDataSource1.SelectMethod = "SelectDVRInfo"; ObjectDataSource1.SelectParameters["MyParameter"]

ASP.NET MVC button multiple clicks

ok i have a form on which i have some validation through dataannotation which is client side as well as server side validation like some field already exists. i have no javascript validations on the page. now my problem is that what should i do if the user presses the save button multiple times (he keeps pressing the button for 15 times,in my case the page stays there with field already exist message at the top ) . what do u guys do for that? what i have done (this works fine in firefox but not in ie) it disable the button no matter what just after click in ie   $(document).ready(function () {     $("#btn").submit(function () {         $('#btn').attr('disabled', 'disabled');     }); });

I need to hide the print button when user clicks print

using vb.net/asp.net 2005.when the user clicks on a linkbutton I am displaying records from my gridview, popping up a new window so that the user can print the records being displayed in the gridview, dvName is the name of the dive that encloses the gridview and gvName is the name of my gridview.The display and print functionality is working fine but the problem is that I am trying to hide the print button from being printed.  When the user clicks on print then all records (good) and the print button (not good) are being printed, here is the javascript that displays the records and the print button.function printDiv(dvName, gvName) { try{ var sOption="toolbar=no,location=no,directories=yes,menubar=no,"; sOption+="scrollbars=yes,width=750,height=600,left=100,top=25"; var countRows = 0; var gridview = document.getElementById(gvName); if(gridview != null) { countRows = gridview.rows.length; if (countRows > 0) { countRows = countRows - 1; } } var sWinHTML = document.getElementById(dvName).innerHTML; var winprint=window.open("","",sOption); winprint.document.open(); winprint.document.write('<html><LINK href=MyStyleSheet.

FormView Command Button not firing Item Command Event

Hi, In my content page, I have a formview for Insert & Edit. In insertitemtempalteI have a command button (btnInsert) to trigger  Item_Command event to insert a new record. The button event never gets triggered. But If I set CausesValidation = "false"it fires. But I want the validation to take place. I tried btnInsert_command and btnInsert_Click events. None of them is fired. Ideally I would like to havethe item_command event fired. I would appreciate any inpyt on how to handle this problem. <FormView>     <InsertItemTemplate>            .....           <div>               <asp:Button id="btnInsert" CommandName="Insert" Text="Insert" runat="server" UseSubmitBehavior="true" />              <asp:Button id="btnCancel" CommandName="Cancel" Text="Insert" runat="server" />           </div>     </InsertItemTemplate></FormView>   Thanks Suresh

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(""));

modal pop up extender button click is not firing


Hi All,


I have a modal pop up extender that is working fine. Inside the modal pop up window I have 2 buttons yes No

If I click on yes I am redirecting it to a diff page. No is simply closing the pop up.

In my .cs file buttonclick I added the response.redirect();

But my OnClick="BtnYes_Click" is never getting fired although I click on the yes button. What is wrong?



<cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" >
                   <asp:Button ID="btnTarget" runat ="server" style="display:none" />

Server button not firing.


I have a form that when all the required fields are selected, I need to enable the server side "Save" button.

My html looks like this:


<asp:Button ID="btnSaveLogEntry" runat="server" Text="Save Log Entry" Enabled="false"
                                                                                    AccessKey="L" Style="width: 150px; font-size: x-smaller; color: #fe8e14; font-style: italic;

Updating Person/Group Field when Current User Clicks Button


Hi all,

Im trying to either add the current user to a multi person/group field or remove them if they are already in the field when they click a button. My code works to decide which button to render on the page - it will show "Add" if the current user is not in the multi person/group field (titled Members) or it will display "Remove" if the current user already exists in the multi person/group field.

My problem is that when the user clicks the button, i want to take the value in the multi person/group field and use XSL string functions to either add/remove the current user to/from the string and push the updated string back into the multi person/group field - This is not working for me. I can reference the correct column with javascript, but it seems the value i get from the person/group column is not just a simple string, its got all sorts of HTML in there. I was hoping just to get a string like, "member1;member2;...). Ive tried changing the field to just display the account (rather than the name with presence), but it still pulls back a huge chunk of code that i cant work with.

Below is my code so far, just to give you an idea - anyone know what im doing wrong?


Button click event handler firing twice

I noticed today that button click event handlers are firing twice for me in some cases when the button is inside an UpdatePanel -- but only in Firefox.  I'm wondering if this might have to do with the Firefox update that came out today because I never noticed this problem until today.  Has anyone else run into this problem?

Why does my event handler need 2 button clicks to work?


I've created a Visual WebPart in 2010 with two buttons.

One works as it should (it updates a database and puts a success string in a label) with no problems

One gets a dataset and populates some labels and textboxes (using a Page.DataBind).

With this button, I need to click it twice (not exactly a double click) - once, let it post back and then click again

If I copy the exact markup and code to a test ASPX project, it all works perfectly as it should.

I've tried both a DataSet and a DataReader - code to populate controls is like the following:


Then, after all, I follow by a Page.DataBind
Within reader.read:
lblSerialNumber.Text = myReader["Serial Number"].ToString();

Does anyone know what could cause this?

AutoPostBack issue with other web controls resulting in multiple clicks on "Save" Button


A new ASP.NET web application that I've been working on has among other web controls on the DetailView, a DropDownList for Category (ddlCategory) a TextBox for Quantity (txtQuantity) a Label for the Rate (lblRate) and a Label for the Amount (lblAmount) along with a Save button (btnSave), etc.; there are also TabIndexes set to progressively navigate from control-to-control ending on the Save button.  NOTE: the user would like to see the Rate & Amount values in the DetailView prior to saving the record.

The Rate is determined by the selected the Category so I have the AutoPostBack property set to "true" on ddlCategory to make a call to the database to retrieve the Rate on the SelectedIndexChanged event; likewise, the AutoPostBack property on txtQuantity is set to "true" in order to compute the Amount (and populate lblAmount) once the user enters a Quantity.  Theoretically, the user could enter the values sequentially and still go back to change the Category prior to the save so simply performing some client-side JavaScript to compute the Amount would not be bulletproof.

Everything works according to plan when the user tabs from control-to-control {e.g., Category > Quantity > Save}, or tabs off the control.  However, the problem occurs when the user enters all the values and then clicks on the Save button without tabbing off the

Button onClick event not firing in Safari 5


Hello All.

I'm am fairly new to ASP.NET and have been experiencing quite an odd problem.  My application works just as I expect it to in IE7 and FF. However, once tested in Google Chrome or Safari, I start to experience issues with the firing of my onClick event.  In Chrome or Safari 4, when I click my button control, it does not seem to recognize that the button has been clicked at all and my onClick event is never fired.  However, upon clicking it a second or third time, it fires.  Annoying.  The real problem is with Safari 5.. No matter how many times I click the button, nothing happens.. Yet I have found that if I tab down to the button and select it using the space bar, it fires... ?? So, I have done a great deal of digging and have found very few posts that describe something similar.  I have read that Chrome and Safari report themselves as WebKit in their userAgent strings, but I believe that only comes into play when using AJAX.  


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Step1.aspx.cs" Inherits="Undergrad_Step1" %>

PreSaveAction is not firing for a custom save button on a Custom List Form

Hi Everybody,
I've created a custom list form using SPD. Now I want to put a custom button for saving and redirecting to another page based on a logic. I am using following script for making a custom Save button.

<input type="button" value="Submit" name="Submit" onclick="{ddwrt:GenFireServerEvent('__commit;__redirect={Confirm.aspx}')}  " />
When the user clicks this button, I am able to save the values, but the validation I have implemented in the PreSaveAction() is not getting activated. I don't understand where the problem is.

Is validation with PreSaveAction()  works only with OOB SaveButton ?

Thanks in advance,
- Loka Samastha Sukhino Bhavanthu : May Eternal Peace & Goodwill Prevail in the Whole World!

Page Load event is not Firing while click on Back Button of Internet


Hi All

I am also facing some issues with Back Button of Internet Browser as well.

Actully Page Load event of my page is not firing when i click on Back Button of Internet.

Please suggest !!!!!!!!

Thanks in advance.

radio button checked changed event not firing with onclick javascript function



I have used below code.

<asp:RadioButton GroupName="grpAssoc" ID="rbtEvery" runat="server" Text="Everyone"
                                                                                    onclick="return doChangeAssociationType(0);" AutoPostBack="True" oncheckedchanged="rbtEvery_CheckedChanged"

but oncheckedchanged="rbtEvery_CheckedChan

Button onclick event not firing when some AJAX controls are introduced



I have a web page which has both asp.net controls as well as AJAX controls.I am facing a weird issue when I introduce some AJAX controls(Modal popup) inside a tabbed panel, the button onClick event stops firing.Can anyone suggest what might be the reason for this?

Here is my code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Entity.aspx.cs" Inherits="Entity" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<asp:Content ID="Content2" ContentPlaceHolderID="HeaderImagePlaceHolder" Runat="Server">
<img src="images/image5.jpg" alt="NewsPageImage" />
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager_TabContainer" runat="server">
      <asp:TabContainer ID="TabContainer_Metadata" runat=&q
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