473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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_SelectedIndexChanged 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 1291
Hi Jesper,

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

Ken

"Jesper Ordrup Christensen"
<Je*********************@discussions.microsoft.com > wrote in message
news:6A**********************************@microsof t.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_SelectedIndexChanged 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.ispostback() 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_SelectedIndexChanged 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*********************@discussions.microsoft.com > wrote in message
news:6A**********************************@microsof t.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_SelectedIndexChanged 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
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...
0
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...
10
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. ...
23
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...
5
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...
4
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...
3
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...
5
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...
0
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.