.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

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

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

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

View Complete Post

More Related Resource Links

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');     }); });

Multiple Paramatized Threading issue


I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running.  Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.

Not getting multiple composite controls on master page


I have created two composite controls in the same assembly and registered that assembly in a master page using <%@ Register tag.

When I try to use these controls using the registered tag prefix I am getting only one control along with the tagprefix .

How to get all the composite controls present in the registered assembly?

how to set multiple button in single image


Hi friends,

I need to make multiple button in a single image in asp.net.

and need coding also for vb.net.

thanx in advance

Custom controls and ViewState management issue



I want to know that when we create custom controls, then is there State Management through ViewState done automatically or we have to handle it explicitely ?Since i have created Custom Controls that is behaving as if it is not maintaining its state on PostBack.

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).

Creating a "Save Button" in a browser based Form

I'm not sure if I'm missing something obvious, but I need to have the funtionality of the "Save Button", which is available and works on the tool bar, available in the form...and I can't seem figure out how to do it.I've found examples, in this forum, of how to use the "Submit Button" to act as the "Save Button", which did work for me, but only when specific basic criteria was met.The criteria that I now have is that I'm initiating a workflow to automatically start when a new item is created.  My workflow then moves the form to one of a few possible different form libraries, based on the logic in my workflow.  The different form libraries are to manage different teams of people that would have access to the Form and then that team would process the form accordingly.My specific situation: 1 - User opens a new form (works) 2 - User enters data and then submits the new form (works) 3 - Workflow is initiated and the form is moved to another form library to be worked on by a select group of people (works) 4 - The form is opened and reviewed and some changes are made to the form data by the select group of people (works) 5 - The form data in the form libary is updated (works, but only if the save button is pressed in the tool bar and then manually closes t

add any number of dynamic controls on press of button

how can i add new control like image on every click of a button. the number of controls added should be number of times i pressed that button

How to I apply an XAML declared animation to multiple controls dynamically?

Hello, How to I apply an XAML declared animation to multiple controls dynamically? Here is the XAML declared animation: <Window.Resources> <Storyboard x:Key="TextBlock_SB"> <DoubleAnimation Storyboard.TargetName="TextBlock_1" Storyboard.TargetProperty="(TextBlock.Opacity)" From="1.0" To="0.75" Duration="0:0:0.5" AutoReverse="True" RepeatBehavior="Forever" /> </Storyboard> Here is the code that starts the animation for TextBlock_1: (this.Resources["TextBlock_SB"] as Storyboard).Begin(); I want to apply the same storyboard/animation to TextBlock_2 and TextBlock_3 and perhaps others.  How do I do that without defining more XAML storyboards? Regards, Robert  

Impersonation issue | Multiple domain

Hi,I am working on an Intranet site.The site is running with the following configurationWindows 2003 Server, IIS 6The users of the site come from 3 different domains (say Domain A, B, C). We have Integrated Windows Authentication turned on. App pool identity - Network Service Impersonation is turned Off in web.config. We try to impersonate the original caller programatically for one functionality where we try to access contents of a folder on shared drive by giving a UNC path. System.Security.Principal.WindowsImpersonationContext impersonationContext;impersonationContext = ((System.Security.Principal.WindowsIdentity)Context.User.Identity).Impersonate();...DirectoryInfo rootDir = new DirectoryInfo(path); DirectoryInfo[] dirContents = rootDir.GetDirectories();// We show the folders and files which can be downloaded after this ..impersonationContext.Undo();  The web server and the file share are on domain AIssue The above functionality works fine for all users coming from Domain A but for users coming in from Domain B and C get System.UnauthorizedAccessException at rootDir.GetDirectories(). But when the same users type the same UNC path from Win>Run or File Explorer, they are able to open it.The users are all coming in through IE6, so they do not have to provide their user name, password as trust has been established between all 3 domains. Can anyone please p

need help to implement validation with save button

hi, i was defeated a problem relating to the save button. i am running vb.net 2005 and the database is access. i have a project with application so there's a form which i wanted to restrict the user to fill all the textfields. say there are 5 textfiled(Fname, email and so on). what i am interested is that when even some one open the form and tries to fill some of them, there should be prompting message asking them to fill all, else the save button has to do its task. here's the code i was playing around but got a problem that when i fill all the text fields, there's no save only the restricting msg appears(" plz, fill the form probably then click save") NB: i put this code inside the save button. --------------------------------------------------------------- Dim success As Boolean Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click If Product_DetailsBindingSource.Current Is Nothing Then MessageBox.Show("plz, fill the  feilds then click save button", Me.Text) success = False Else Me.Validate() success = DirectCast(Product_DetailsBindingSource.Current, products).Save() MessageBox.Show("save has completed successfully") Panel1.Show() End If   ------------------------ thanks so mch best regards hossenel

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"]

Is it Possible to Reuse a Trigger on Multiple Controls Easily?

I have a simple trigger that is generic such that I would like to reuse it on 15 different labels. Can I define it in one place somehow and just assing it to each of the labels rather than just pasting the same code into the style for each label?

Enable Disable Save Button in Winforms App

Hi, In our windows forms application we have many forms with "Save" buttons. We want to enable them only if the data in the form is changed. At the moment it is handed by adding flags to check whether the data is dirty. Is there any easy way to handle this? May be something with the famework? Thanks,CJ

Issue accessing textbox controls nested within a DetailsView within an UpdatePanel

I have a couple of textboxes nested with a detailsview, within an updatepanel.  When I try and access them from the code behind, it returns a null value as if they don't exist.  Can't figure out why that would be.ASPX code is: <asp:UpdatePanel ID="upSpecificShout" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" > <ContentTemplate> <asp:DetailsView ID="dvSingleShout" DataSourceID="sdsSingleShout" runat="server" AutoGenerateRows="false" OnDataBound="SetDVIcons" HeaderStyle-CssClass="noDisplay" > <EmptyDataTemplate> <p class="Watermark"> The panel on the left shows a list of everything you've shouted. (Your replies to other shouts are highlighted in blue/green.) </p> <p class="Watermark"> This right hand panel will show specific shouts with a list of replies etc.. Just do a little click on a shout title to display more detail here. </p> <p class="Watermark">

Confirmation prompt when click on "save" button?

Currently I am working on SharePoint 2010 project that my customer want something like confirmation prompt, (e.g. upon click on “save” button, system prompts “are you sure you want to save?”) for all following 8 area: ·         Document Repository (meta-data) ·         Calendaring ·         News ·         Task List ·         Quick Links ·         Blogs ·         Wiki ·         Forums   Is this possible?  Has anyone done this or something similar?  Can anyone point me to some examples or best practices when doing this? Thanks Believing is Seeing

Sequential firing of button clicks

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
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