Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Event handlers called multiple times

Reply
Thread Tools

Event handlers called multiple times

 
 
Tumurbaatar S.
Guest
Posts: n/a
 
      11-11-2005
My DataGrid's event handlers looks like:
Grid_ItemDataBound(...)
{
switch (e.Item.ItemType):
{
case ListItemType.Footer:
...// BREAKPONT FooterBound
break;
case ...// other item types
}
}

and

Grid_ItemCreated(...)
{
if (e.Item.ItemType == ListItemType.Pager)
{
...// BREAKPONT PagerCreated
}
}

During debug session I put 2 breakpoints as shown above. And I noted strange
things:
1. On the first time, events are called in this order: PagerCreated,
FooterBound, PagerCreated.
I.e. Pager item created event raised 2 times!
2. After postback they are called: PagerCreated, PagerCreated, PagerCreated,
FooterBound, PagerCreated
Now Pager item created event raised 4 times!!!

What is happening?

P.S. Can anybody recommend me any reference about event calling in ASP.NET
which explains all above things?




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple sproc executes 240 times slower when called from asp.net thanwhen called from QA Radu ASP .Net 7 08-28-2009 09:09 PM
Why is a button Click event also called when a textbox TextChanged event is called??? S_K ASP .Net 6 11-08-2007 07:44 PM
Profile Personalize event called Multiple times =?Utf-8?B?UHJhc2FubmEgUGF0dGFt?= ASP .Net 1 06-20-2006 01:58 PM
three times copy ctor called, one ctor called, why? Apricot C++ 4 04-16-2004 07:55 AM
Why is the Constructor called 4 times but the Destructor 5 times? djskrill C++ 9 10-01-2003 07:18 PM



Advertisments