473,508 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid Efficency of setting embeded control properties inline or with codebehind

I have a DataGrid that needs to set many properites on its embeded controls
in the ItemTemplate and EditItemTemplate Templates. I have a choice between
using the inline <%# %> or the OnItemCreated / OnDataBound codebehind events
to set these properties. Is one way more effiecent then the other? I know
from classic ASP that doing a lot of context switching within a page was not
very efficient. Is that still that case in this senerio?

Thank you for your help

Earl
Nov 18 '05 #1
1 1239
Hi Eerl:

In asp.net there is no overhead in <% %> switching as in ASP days.
There can be, however, some additional overhead if you are using a lot
of DataBinder.Eval inside of the blocks versus writing code in the
code-behind.

In the end you'll have to measure the difference usng your specific
code, since "a lot" and "many properties" are relative terms.

I'd chose what feels best from a maintenance perspective and work from
there.

--
Scott
http://www.OdeToCode.com
On Fri, 9 Jul 2004 10:24:32 -0500, "Earl Teigrob"
<ea******@hotmail.com> wrote:
I have a DataGrid that needs to set many properites on its embeded controls
in the ItemTemplate and EditItemTemplate Templates. I have a choice between
using the inline <%# %> or the OnItemCreated / OnDataBound codebehind events
to set these properties. Is one way more effiecent then the other? I know
from classic ASP that doing a lot of context switching within a page was not
very efficient. Is that still that case in this senerio?

Thank you for your help

Earl


Nov 18 '05 #2

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

Similar topics

1
1499
by: Michael Gorbach | last post by:
Iv got a StatisticsContainer object that contains an arraylist of objects of different types, all inherited from class Statistic. The statistics class has 2 string public properties, name and...
5
12209
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
1
840
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
4
1324
by: Paul King | last post by:
Hi there, Im trying to setup an ASP DataGrid to format my results in a clear manner. I have 3 fields to bring back into the grid, these are Date, Venue and Comments. However I would like to...
0
1219
by: Tigrou | last post by:
Hello, I'm searching for a solution who permit me to create an TemplateColumn in a DataGrid into codebehind... I found only solution for create it into the ASPX code... My problem is to find...
2
3114
by: Tigrou | last post by:
Hello, I'm searching for a solution who permit me to create an TemplateColumn in a DataGrid into codebehind... I found only solution for create it into the ASPX code... My problem is to find...
5
1429
by: ~~~ .NET Ed ~~~ | last post by:
Well, maybe not half-baked but 75%. I find very frustrating working with the DataGrid control. It offers a lot of functionality which really comes in handy. Unfortunately you can only enjoy a...
2
2834
by: Tim::.. | last post by:
Hi I'm trying to create a little application that shows an image of a user when you mouseover there details in a datagrid. The datagrid is populated from an Active Directory Database and I...
2
1493
by: seth | last post by:
The Environment: I have a 3rd party control referenced as an object on an aspx page with inline code in script tags accessing the methods of properties of same. I also have a Codebehind page...
0
7223
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,...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7377
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...
1
7036
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...
0
7489
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...
0
5624
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,...
1
5047
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...
0
4705
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.