473,651 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onItemDataBound event not firing on first go thru since moving to .net 2.0

TS
I have this custom data list control and i override the onItemDatabound
event. After upgrading to vs 2005, this event is not always getting called,
though it does at other times. No changes were made when upgrading to 2.0

is there any reason for this because of .net 2.0?

thanks
Nov 27 '06 #1
14 8667
What type of control is this? In general, I think the event is
ataBound in .NET 2.0.

TS wrote:
I have this custom data list control and i override the onItemDatabound
event. After upgrading to vs 2005, this event is not always getting called,
though it does at other times. No changes were made when upgrading to 2.0

is there any reason for this because of .net 2.0?

thanks
Nov 27 '06 #2
TS
it is a control that inherits from DataList. The databinding does occur
after the page has posted back in some other parts of code - which correctly
calls the onDataBound event.

Also, this code worked correctly in 1.x but now fails.

thanks!

"Eric" <ve****@gmail.c omwrote in message
news:11******** *************@4 5g2000cws.googl egroups.com...
What type of control is this? In general, I think the event is
ataBound in .NET 2.0.

TS wrote:
>I have this custom data list control and i override the onItemDatabound
event. After upgrading to vs 2005, this event is not always getting
called,
though it does at other times. No changes were made when upgrading to 2.0

is there any reason for this because of .net 2.0?

thanks

Nov 27 '06 #3
TS
Also Why is it that this custom dataList of mine calls DataBind()
automatically (i know this because when my itemDataBound event runs, it runs
twice when i manually call DataBind())?

I also have a regular dataGrid on the page, but if i dont' set DAtaBind()
for it, it won't bind itself. Since DataList and DataGrid both inherit from
BAseDataList, i would expect both to either call databind() automatically or
not at all.

Whats the deal here?

thanks

"TS" <ma**********@n ospam.nospamwro te in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>I have this custom data list control and i override the onItemDatabound
event. After upgrading to vs 2005, this event is not always getting called,
though it does at other times. No changes were made when upgrading to 2.0

is there any reason for this because of .net 2.0?

thanks

Nov 27 '06 #4
TS
I have been looking at
http://msdn2.microsoft.com/en-us/library/aa479321.aspx but it doesn't
mention the base class for DataList, BaseDataList. Am i to assume that the
topics in this article don't relate to DAtaList or DataGrid (both inherit
from BaseDataList)?

thanks

"TS" <ma**********@n ospam.nospamwro te in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>I have this custom data list control and i override the onItemDatabound
event. After upgrading to vs 2005, this event is not always getting called,
though it does at other times. No changes were made when upgrading to 2.0

is there any reason for this because of .net 2.0?

thanks

Nov 27 '06 #5
TS
actually i think that it doesn't call DataBind() automatically, i found a
spot that was calling it anyways.
"TS" <ma**********@n ospam.nospamwro te in message
news:ug******** ********@TK2MSF TNGP02.phx.gbl. ..
Also Why is it that this custom dataList of mine calls DataBind()
automatically (i know this because when my itemDataBound event runs, it
runs twice when i manually call DataBind())?

I also have a regular dataGrid on the page, but if i dont' set DAtaBind()
for it, it won't bind itself. Since DataList and DataGrid both inherit
from BAseDataList, i would expect both to either call databind()
automatically or not at all.

Whats the deal here?

thanks

"TS" <ma**********@n ospam.nospamwro te in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>>I have this custom data list control and i override the onItemDatabound
event. After upgrading to vs 2005, this event is not always getting
called, though it does at other times. No changes were made when upgrading
to 2.0

is there any reason for this because of .net 2.0?

thanks


Nov 27 '06 #6
If a control has a DataSource, DataBind will automatically be called.
I'm not sure if this is the case for you or not.

Are you using .NET 1.1 or 2.0? It sounds like you're still using 1.1.
2.0 doesn't have the DataGrid control (it has been replaced with the
GridView) and the onItemDatabound event is generally called DataBound.

TS wrote:
actually i think that it doesn't call DataBind() automatically, i found a
spot that was calling it anyways.
"TS" <ma**********@n ospam.nospamwro te in message
news:ug******** ********@TK2MSF TNGP02.phx.gbl. ..
Also Why is it that this custom dataList of mine calls DataBind()
automatically (i know this because when my itemDataBound event runs, it
runs twice when i manually call DataBind())?

I also have a regular dataGrid on the page, but if i dont' set DAtaBind()
for it, it won't bind itself. Since DataList and DataGrid both inherit
from BAseDataList, i would expect both to either call databind()
automatically or not at all.

Whats the deal here?

thanks

"TS" <ma**********@n ospam.nospamwro te in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>I have this custom data list control and i override the onItemDatabound
event. After upgrading to vs 2005, this event is not always getting
called, though it does at other times. No changes were made when upgrading
to 2.0

is there any reason for this because of .net 2.0?

thanks
Nov 28 '06 #7
Although it's recommended to use GridView in 2.0, DataGrid is still
supported in 2.0. It's actually improved to support a new way of
databinding that using DataSource control.

When you're using declarative way to set the DataSourceID property of a
data-bound control, you don't have to call DataBind() manually; but you
have to call DataBind() if you're setting DataSource property in code.

TS, would you please post some code of your DataList inherited control?
Thanks.
Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 28 '06 #8
TS
to re-iterate, after the first time the databind event occurs during a
postback, it fails. The second time and every time after that, you postback
and call it and it works.

"TS" <ma**********@n ospam.nospamwro te in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>i have attached the code and this is the method that binds it:
private void LoadReport()
{
this.report = new Report(GetRepor tXmlDocument(), mReportName, "table",
"TEA");
this.rplCriteri a.ControlsAssem blyFile =
this.report.Bas eControlAssembl yFile;
this.rplCriteri a.DataSource = this.report.Par ameters;
this.rplCriteri a.DataBind();

// If the report contains no control parameters & not initial page load,
go straight to the report viewer
if (this.rplCriter ia.Items.Count == 0 && IsPostBack){
RunReport();
}
else{
this.lblReportT itle.Text = this.report.Tit le;
}
}

every time when it goes to bind, its data source has items. The first or
second time the page posts back, the onItemDataBound event won't fire,
after that it does. Again, the datasource is the same always, and the code
worked correctly in 1.x.

thanks!

"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:4z******** ******@TK2MSFTN GXA01.phx.gbl.. .
>Although it's recommended to use GridView in 2.0, DataGrid is still
supported in 2.0. It's actually improved to support a new way of
databinding that using DataSource control.

When you're using declarative way to set the DataSourceID property of a
data-bound control, you don't have to call DataBind() manually; but you
have to call DataBind() if you're setting DataSource property in code.

TS, would you please post some code of your DataList inherited control?
Thanks.
Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

============== =============== =============== ======
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear
the
check box "Tools/Options/Read: Get 300 headers at a time" to see your
reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
============== =============== =============== ======

This posting is provided "AS IS" with no warranties, and confers no
rights.



Nov 28 '06 #9
TS
OK the way the page is set up, initial page load occurs then a postback
occurs which calls the databind. If I put a call to databind during initial
page load, the itemDataBound event is called correctly. For some reason the
intial call to databind when called during the 1st postback is causing
problems.

One other thing to keep in mind is that for some reason the page_load &
page_pre_render are running twice (probably all the page's events). The page
load runs twice, then pre-render runs twice in that exact order, so it
DOESNT' do a load-->pre-render-->Load-->pre-render. IT DOES
load-->load-->pre-render-->pre-render. I am attaching the stack track to
show you the difference comparing the 1st load to the 2nd load which both
occur on a single request for the page.

I have verified that this does not happen in VS 2003 with the same page and
i can find no other pages in vs 2005 that have their load event run twice.
This page is identical except for vs 2005 specific revisions which don't
change anything. This page does have a base class, but its load event only
runs ONCE!

When I put a call to databind during initial page load, the itemDataBound
event is called correctly for both page posts.

If you think double events firing is unrelated to our issue then no
investigation is required.

Thanks!

"TS" <ma**********@n ospam.nospamwro te in message
news:eN******** ******@TK2MSFTN GP02.phx.gbl...
to re-iterate, after the first time the databind event occurs during a
postback, it fails. The second time and every time after that, you
postback
and call it and it works.

"TS" <ma**********@n ospam.nospamwro te in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
>>i have attached the code and this is the method that binds it:
private void LoadReport()
{
this.report = new Report(GetRepor tXmlDocument(), mReportName, "table",
"TEA");
this.rplCriter ia.ControlsAsse mblyFile =
this.report.Ba seControlAssemb lyFile;
this.rplCriter ia.DataSource = this.report.Par ameters;
this.rplCriter ia.DataBind();

// If the report contains no control parameters & not initial page load,
go straight to the report viewer
if (this.rplCriter ia.Items.Count == 0 && IsPostBack){
RunReport();
}
else{
this.lblReport Title.Text = this.report.Tit le;
}
}

every time when it goes to bind, its data source has items. The first or
second time the page posts back, the onItemDataBound event won't fire,
after that it does. Again, the datasource is the same always, and the
code
worked correctly in 1.x.

thanks!

"Walter Wang [MSFT]" <wa****@online. microsoft.comwr ote in message
news:4z******* *******@TK2MSFT NGXA01.phx.gbl. ..
>>Although it's recommended to use GridView in 2.0, DataGrid is still
supported in 2.0. It's actually improved to support a new way of
databinding that using DataSource control.

When you're using declarative way to set the DataSourceID property of a
data-bound control, you don't have to call DataBind() manually; but you
have to call DataBind() if you're setting DataSource property in code.

TS, would you please post some code of your DataList inherited control?
Thanks.
Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

============= =============== =============== =======
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear
the
check box "Tools/Options/Read: Get 300 headers at a time" to see your
reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
follow
up response may take approximately 2 business days as the support
professiona l working with you may need further investigation to reach
the
most efficient resolution. The offering is not appropriate for
situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are
best
handled working with a dedicated Microsoft Support Engineer by
contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
============= =============== =============== =======

This posting is provided "AS IS" with no warranties, and confers no
rights.





Nov 28 '06 #10

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

Similar topics

2
7286
by: Jared Baszler | last post by:
I just wanted to write and ask why the below behavior is occuring. I've simply put a list box on a form and populated it with two items. I'm handling both the SelectedValueChanged event and the Click event. The reason being because sometime I change the selected item programmatically and sometimes the user selects the item. I'm wondering why selectedID, which is being set in SelectedValueChanged, is being displayed differently in the...
5
2798
by: Steve M | last post by:
Why are my sessions lasting so long? I have them set to 20 minute timeout in config file? The Session_End event is getting called an hour or more sometimes--well after the user has stopped interacting with my site. Anyone have any insight? Thanks in advance
7
2342
by: Shane Bishop | last post by:
I've been fighting with the Page_Load event firing twice. I looked through this user group and saw several other people having similar problems. There were various reasons for it: AutoEventWireup="true" instead of AutoEventWireup="false" Spyware software And having your events all wired wrong I had done everything to my machine, stripped it down to just have ..NET on it and I was still having this problem until...
4
6084
by: Larry Morris | last post by:
The following code, pasted into a web form with a link button on it, will cause the page_unload event to fire twice. If I remove the response.redirect, the problem goes away :). I've got a work around, but I'm curious how one is supposed to programmatically navigate between web pages without the page_unload event firing twice. Thanks, Larry
2
1994
by: Dan | last post by:
I have an aspx page with a form on it. There are a couple of textboxes and an ImageButton. The page is loaded from another page using Server.Transfer. When I click on the ImageButton, the Page_Load event immediately fires on the codebehind page and then click event fires. When this happens, the Page.IsPostBack property is true in the page_load event. Why is the page_load event firing before the ImageButton_Click event?
1
1514
by: rmccinc | last post by:
OK, I am running into some issues that I cant figure out a work-around. I am not going to post code cause I figured out WHY my issue is happening: -I have a datagrid, and a button that fires a click event. -The Datagrids onitemdatabound event dynamically creates validation controls per values from other columns in the datagrid, one of those controls is a textbox and it is the ControlToValidate of the validation control.
16
9180
by: tommaso.gastaldi | last post by:
Hello, A probably dumb question... does anyone know hot to avoid that if one keep the mouse pressed on an arrow of the numericUpDown it continues to fire events (it uses evidently a timer) ? I want 1 event for each click, and no timer activation. I have tried using disable within the handler but does not work.
0
1124
by: =?Utf-8?B?THVpZ2k=?= | last post by:
Hi all, I have a ComponentArt Menu like this: <ComponentArt:Menu ID="NavigationMenu" runat="server" ......... I need to intercetp the OnItemDataBound event in master.cs, where the component is placed. But in debug mode (VS2005) I never got in the method: protected void NavigationMenu_ItemSelected(object sender, MenuItemEventArgs e)
7
1827
by: Andrus | last post by:
I noticed that DataGridView CellValidated() and other event handler first parameter is object: Grid.CellValidated+=new DataGridViewCellEventHandler(Grid_CellValidated); .... void Grid_CellValidated(object sender, DataGridViewCellEventArgs e) { .....
0
8347
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
8694
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
8457
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,...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5605
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
4143
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...
0
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1905
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1585
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.