473,597 Members | 2,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET events firing twice

I have an asp.net(2003) form that uses web server controls
event architecture. The form has edit, cancel, save,
delete buttons on it. When the delete button is clicked
the following events fire.

PageLoad
btnDelete_Click
PageLoad
btnDelete_Click

One of the other buttons executes it's code twice as well,
but I am able to work around it. I can't work around the
delete issue since the id of the record to be deleted
remains within the document. I tried using a variable, but
the variable is reset between the PageLoad events. It is
actually processing the events on two separate threads and
I am not sure why.

AutoEventWireup is set to false for the page as I have
seen a few articles on the web that discuss that issue.

Also, I have verified that the InitializeCompo nent section
that binds the events to the code blocks is not
duplicated.

Help if you can!

Kory Pukash
MCSD, MCT
Jul 21 '05 #1
2 1670
I believe if you make a simple Asp.Net application with a page having
several buttons, and a Delete button will not fire events twice. So there
are must be something special in your architecture or code. Check them.

-jl

"Kory Pukash" <pu*****@idhw.s tate.id.us> wrote in message
news:00******** *************** *****@phx.gbl.. .
I have an asp.net(2003) form that uses web server controls
event architecture. The form has edit, cancel, save,
delete buttons on it. When the delete button is clicked
the following events fire.

PageLoad
btnDelete_Click
PageLoad
btnDelete_Click

One of the other buttons executes it's code twice as well,
but I am able to work around it. I can't work around the
delete issue since the id of the record to be deleted
remains within the document. I tried using a variable, but
the variable is reset between the PageLoad events. It is
actually processing the events on two separate threads and
I am not sure why.

AutoEventWireup is set to false for the page as I have
seen a few articles on the web that discuss that issue.

Also, I have verified that the InitializeCompo nent section
that binds the events to the code blocks is not
duplicated.

Help if you can!

Kory Pukash
MCSD, MCT

Jul 21 '05 #2
One of our UI developers has also experienced this
problem. In his case the control in question was in a user
control and the double button click occurred on a login
page. The problem started appearing just after we upgraded
to 1.1 and the VS.NET 2003. I think it might be a known
bug, but he was able to work around it.

Hope This Helps,
Chris
-----Original Message-----
I have an asp.net(2003) form that uses web server controlsevent architecture. The form has edit, cancel, save,
delete buttons on it. When the delete button is clicked
the following events fire.

PageLoad
btnDelete_Clic k
PageLoad
btnDelete_Clic k

One of the other buttons executes it's code twice as well,but I am able to work around it. I can't work around the
delete issue since the id of the record to be deleted
remains within the document. I tried using a variable, butthe variable is reset between the PageLoad events. It is
actually processing the events on two separate threads andI am not sure why.

AutoEventWireu p is set to false for the page as I have
seen a few articles on the web that discuss that issue.

Also, I have verified that the InitializeCompo nent sectionthat binds the events to the code blocks is not
duplicated.

Help if you can!

Kory Pukash
MCSD, MCT
.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2652
by: Steve Wilkinson | last post by:
Is there any method I can use to determine the number of subscribers to a controls events. In particular I'm looking at the ComboBox.SelectedIndexChanged event, I have a scenario where I need to cancel the SelectedIndexChanged event and restore the original SelectedIndex property. To do this I unsubscribe the SelectedIndexChanged event, update the SelectedIndex property and then re-subscribe. I need to do this to prevent the...
3
2286
by: Mike | last post by:
Hi, I am adding controls dynamically in a WebForm, but none of these controls' events fire. Here is the class code I am using. I have tried so many things, but nothing works :-( namespace WebApplication1 { using System;
7
4568
by: Denise | last post by:
I just realized the DataTable_RowChanging events were firing when I called Fill method of the DataAdapter! It fires TWICE for each row loaded. I thought these were only supposed to be called when data was actually being edited. I am using bound textbox controls on the form. Could that have anything to do with it? Does anyone know how to stop the RowChanging events from firing? Thanks!
2
356
by: Kory Pukash | last post by:
I have an asp.net(2003) form that uses web server controls event architecture. The form has edit, cancel, save, delete buttons on it. When the delete button is clicked the following events fire. PageLoad btnDelete_Click PageLoad btnDelete_Click
5
1763
by: Paal Berggreen | last post by:
I am involved with development of a Portal solution using ASP.NET 2.0 and WebParts. The WebParts framework use the default personalization providers, and the personalization data thus ends up in the aspnetdb database (which we have placed on a proper SQL Server, not SQL Server Express). Everything works like a charm, with the following exception: New users in the system have to press links or buttons twice upon their first logon to...
20
3949
by: David Levine | last post by:
I ran into a problem this morning with event accessor methods that appears to be a bug in C# and I am wondering if this a known issue. public event SomeDelegateSignature fooEvent; public event SomeDelegateSignature foo2Event; { add { // some code here } remove { // some code here }
0
1158
by: tshad | last post by:
I am curious as to why my events from my radio buttons are executing twice? I am using VS 2003 and the event declaration is: private void InitializeComponent() { this.Button3.Click += new System.EventHandler(this.Button3_Click); this.NewBatches.CheckedChanged += new System.EventHandler(this.NewBatches_CheckedChanged); this.AllBatches.CheckedChanged += new
4
16849
by: Marc Solé | last post by:
Hello everybody, I have a little "problem". I have a DataGridView that is loaded automatically by code sometimes, and manually by the user other times. When the user introduces data in the DataGridView, there are some events that control the introduced data for any errors the user can do. That's OK. But when the data is loaded automatically, it is supposed that this data is
4
2036
by: Joergen Bech | last post by:
I sometimes use delegates for broadcasting "StateChanged" events, i.e. if I have multiple forms and/or controls that need updating at the same time as the result of a change in a global/common object, I keep local references to this object in each UI object, e.g. Private WithEvents _tools As RepeatTools and catch messages in an event handler like this:
0
7969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8272
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8035
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6688
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5431
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3886
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2404
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1238
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.