473,625 Members | 2,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

events fireing too many times?

Hi all,

I've designed a webform that has the following controls:

1. dropdown with autopostback
2. datagrid with an OnItemCreated event

The idea is that the dropdown defines a filter.

When I select a value in the drop down the following happends:

1. The page_init event is fired (OK)
2. The OnItemCreated event is fired (why dammit *** )
3. The Page_load event is fired (OK)
4. The Dropdown_Select edIndexChanged event is fired ... (a bit late but ...)
5. The OnItemCreated event is fired (OK)

The problem is the first time the onItemCreated event is fired ... the
datasource is not (re)bound yet ..

Is this the intentional sequence of events or could I have done something to
disturb it?

Regards Jesper
Nov 18 '05 #1
2 1305
Hi Jesper,

Are you binding to the data on each postback? That would cause problems.

Ken

"Jesper Ordrup Christensen"
<Je************ *********@discu ssions.microsof t.com> wrote in message
news:6A******** *************** ***********@mic rosoft.com...
Hi all,

I've designed a webform that has the following controls:

1. dropdown with autopostback
2. datagrid with an OnItemCreated event

The idea is that the dropdown defines a filter.

When I select a value in the drop down the following happends:

1. The page_init event is fired (OK)
2. The OnItemCreated event is fired (why dammit *** )
3. The Page_load event is fired (OK)
4. The Dropdown_Select edIndexChanged event is fired ... (a bit late but
...)
5. The OnItemCreated event is fired (OK)

The problem is the first time the onItemCreated event is fired ... the
datasource is not (re)bound yet ..

Is this the intentional sequence of events or could I have done something
to
disturb it?

Regards Jesper


Nov 18 '05 #2
Hi Ken,

Short answer: no.

Longer one:

In the Page_Load event I do the !Page.ispostbac k() check.

But the data is an array of objects and if the user has selected another
data subset, then I need to bind a new array to the datagrid. I do this in
the Dropdown_Select edIndexChanged event.

Jesper
"Ken Cox [Microsoft MVP]" wrote:
Hi Jesper,

Are you binding to the data on each postback? That would cause problems.

Ken

"Jesper Ordrup Christensen"
<Je************ *********@discu ssions.microsof t.com> wrote in message
news:6A******** *************** ***********@mic rosoft.com...
Hi all,

I've designed a webform that has the following controls:

1. dropdown with autopostback
2. datagrid with an OnItemCreated event

The idea is that the dropdown defines a filter.

When I select a value in the drop down the following happends:

1. The page_init event is fired (OK)
2. The OnItemCreated event is fired (why dammit *** )
3. The Page_load event is fired (OK)
4. The Dropdown_Select edIndexChanged event is fired ... (a bit late but
...)
5. The OnItemCreated event is fired (OK)

The problem is the first time the onItemCreated event is fired ... the
datasource is not (re)bound yet ..

Is this the intentional sequence of events or could I have done something
to
disturb it?

Regards Jesper


Nov 18 '05 #3

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

Similar topics

4
5907
by: Curious George | last post by:
I have a frameset with multiple aspx pages whithin it. I lauch the page and notice that it triggers many session_start events. In fact I knotice multiple events for the same page. I am also using windows authentication. On a few pages I get guest and then the user who is loged into the computer. I am writing user information to my session and do not want it writen 8 times.
0
1093
by: 2 | last post by:
hi, i'm using IComponentChangeService to catch events during designtime. the event i catch is 'OnComponentAdded' from mybutton derived from Forms.button. the problem is now, that this event is fired for every myButton dropped on the form. this means, if i have already 2 myButons on form an drop a third button, the event is fireing thrice. for each component with the same type. > Also keep in mind with the 'IComponentChangeService'...
10
1696
by: Kai Thorsrud | last post by:
Hi i'm an event Noob and i'm calling a class from my main module console app like this. I'm sorry if this is a lot of code to read but i can't see the error according to my book. Thanks a LOT. if there are other noobs here like me feel free to use my code if it's of any use :) I've set a breakpoint at doWorkOnChangedFile but notinh happens... i'm flooding my log like hell.
23
6489
by: pamelafluente | last post by:
Hi guys! I want to do a large number of scheduled task (say 80). Each task can be run at a certain time every given weekday. For instance at 10am and 5pm on each monday, etc. I would like to ask what is the best approach to check and run the scheduled events. The first (perhaps silly) thing that come up in my mind is to use a
5
2761
by: Daniel | last post by:
Hey guys When you hook an event (c# 2.0 syntax): myEvent += MyMethodToFire; You need to also unsubscribe it to avoid a resource leak so that the object it is in gets garbage collected like so : myEvent -= MyMethodToFire; That's all fine, but when you use visual studio to create events for objects it never creates an unsubscribing reference, so is it puting in resource leaks? Or is this being cleared somewhere that i am not seeing?
4
2046
by: jehugaleahsa | last post by:
Hello: Is there a way to prevent one event from firing while another event is already being fired? I have a tool that extracts media from web pages and it has multiple events firing when the status of the download changes. Some of the events are used to tell the next file to download while others manager other resources. However, on occasion, one event will
3
1626
by: =?Utf-8?B?amRrYzRk?= | last post by:
I have been designing an application in Visual Studio 2005, and just about everything is working, except all of my events run twice. They run through correctly, but then they randomly run through a second time. For example, if I click cancel on the main form, it properly triggers the event, but it does so twice. The main program is program.cs, and it calls the others. Here is the source code, its too long to list here, so here are some...
5
2029
by: Peter Duniho | last post by:
On Sat, 27 Sep 2008 12:02:04 -0700, <timor.super@gmail.comwrote: You don't, not when you don't know that one event is necessarily going to follow another. If the events can appear alone, then you can't make them depend on each other. You don't describe what this "thing" you are doing is. But it's bad design to have some "thing" you do in response to user input like this be something that can't be done repeatedly. For example, any...
0
1179
by: qreg | last post by:
I've got a problem with usercontrols and delegating events from the controls that are inside such a usercontrol control. First for a brief description of the problem. I have a user control containing a label and a textbox. I need to linkt the event like click(), mousemove, mousedown etc. in such a manner that clicking the control inside the user control (i.e. label) would result in fireing the event for the usercontrol. This would not be...
0
8251
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
8688
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...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
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
8494
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
5570
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
4085
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
1800
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1496
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.