473,765 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best practice - should DataBinder.Eval be used in a 3-tier architecture?

Pretty much, TSIA, but I'll expand a bit: I'm still trying to get my
head around the n-tier approach to web design. It seems to me that
when you use DataBinder.Eval in the ASPX that your tiers aren't fully
separated. If you're displaying data in a DataGrid, is it appropriate
to define a label in your template column as

<asp:Label runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "MyField")% >' />

or is it better to do that in the code-behind as part of a databind
event? Or am I missing the point because really the .aspx.cs
code-behind is really still part of the presentation layer? It just
seems counter-intuitive: I'd like to be able to say to someone, "you
go design the front-end and make it all pretty, and I'll work on the
data and business tiers." But it seems like we can't do that (at
least at the .aspx level if not the code-behind) unless they have
knowledge of specific field names and stuff when we're using
DataBinder.Eval .

If anyone can provide me with some pros and cons of the
DataBinder.Eval in .aspx approach, I'd appreciate it!

Lerch

Nov 18 '05 #1
1 2240
I use DataBinder.Eval as i use a lot of repeaters as our designers dont want
fixed table layouts like you get with a datagrid.

As far as worrying about a ntier solution... Just because you use
databinder.eval doesnt mean you can design it with a property nteir
solution.

As we use typed and untyped custom objects that inherit from datasets to
store our data. And we use this to bind to the repeater or whatever the
object is.

however as long asy ou arent bind a datareader to the repeater then you can
still design ina nteir way.

As far as wanting peopel to design the front end of a site... then mayeb the
approach you are using is not right.

what i have found works really well is the followg.

1) Build the site in PURE HTML First... iron out all UI issues and design
issues before even touching code... helll even make sure the file names are
..htm

while that is being done... or after you have done it..

Build you backend code... you biz objects and data access , core etc.

then put it alltogether...

that way once you get to putting the site togehter you dont have designer
trying to play around with all the aspx pages as their job is already done.
anyway just my 2 cents worth.... sorry about any mistakes or typos.. just
ina hurry this morning
"Mike Lerch" <ml************ ****@bigfoot.co m> wrote in message
news:pi******** *************** *********@4ax.c om...
Pretty much, TSIA, but I'll expand a bit: I'm still trying to get my
head around the n-tier approach to web design. It seems to me that
when you use DataBinder.Eval in the ASPX that your tiers aren't fully
separated. If you're displaying data in a DataGrid, is it appropriate
to define a label in your template column as

<asp:Label runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "MyField")% >' />

or is it better to do that in the code-behind as part of a databind
event? Or am I missing the point because really the .aspx.cs
code-behind is really still part of the presentation layer? It just
seems counter-intuitive: I'd like to be able to say to someone, "you
go design the front-end and make it all pretty, and I'll work on the
data and business tiers." But it seems like we can't do that (at
least at the .aspx level if not the code-behind) unless they have
knowledge of specific field names and stuff when we're using
DataBinder.Eval .

If anyone can provide me with some pros and cons of the
DataBinder.Eval in .aspx approach, I'd appreciate it!

Lerch

Nov 18 '05 #2

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

Similar topics

0
3814
by: Michelle Keys | last post by:
Subject: DataBinder.Eval Error! Server Error in '/MSPOS' Application. ------------------------------------------------------------------------ -------- DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name REPORTTO. Description: An unhandled exception occurred during the execution of the
2
2047
by: dm_dal | last post by:
I have a control on my webform that I am binding to a dataset. The issue is, the field value in the dataset is encrypted and I am trying to decrypt it during the binding process: Example: <asp:Lable ID="myLable Text='<%# myComponent.Decrypt(DataBinder.Eval(myDataSet, "Tables.DefaultView..MyField")) '></asp:Label>
5
724
by: bg | last post by:
Hi! How do I check if "date" exists before using that code? I've built a RSSreader and sometimes there's a date in it and sometimes not. How can I check if it exists to avoid crash (DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with the name date) <asp:DataGrid id="RssNewsGrid"
4
2491
by: Søren Lund | last post by:
Hello, I am trying to bind a DataGrid with some data from a DataSet which contains fields in the form "group.fieldname". I am certain that my data source contains the field but I cannot get my head around which syntax to use when specifying which field to bind to the DataGrid. I have tried <%# DataBinder.Eval( Container.DataItem, "Group.FieldName" ) %>
6
2055
by: MattC | last post by:
When I add a template column to a DataGrid and bind some data from an object in a collection using the following: <% DataBinder.Eval(Container, "DataItem.Department.DepartmentName") %> What Namespace/Class is Eval located in and can I call if from code behind. I have implemented my own version of reflection nased property navigation but I'd really rather use the original wheel than reinvent it. TIA
2
5423
by: Patrick Olurotimi Ige | last post by:
If have i a funtion below:- Protected Function CheckUnit(Units As Object) As String '----------------------------------------- ' If the Units returned equals to Zero, ' a message of "Out of Units" will be displayed. ' Otherwise, displayed the original value '----------------------------------------- If Integer.Parse(Units) = 0 Then
3
2271
by: Eric Newton | last post by:
Given databinding an array of System.Version types: Given that "SomeObject" type has a Version property: public class SomeObject { public Version Version { get; } public string Description { get; } }
11
34543
by: eddy de boer | last post by:
Hello, in my aspx page I have the followong code: <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> .... <%# Server.HtmlDecode((string)DataBinder.Eval(Container.DataItem,"tekst")) %> .... </ItemTemplate>
4
7350
by: CharlesA | last post by:
a general question... I'm a bit mystified by Databinder.eval(object, Colname, ) if controls can be bound to their individual data sources within the load event of the page... why would we ever use this quite inelegant OO code wrapped in #<% %> inside the markup? secondly: sometimes you see simliar code inside the markup without calls to
1
1363
by: craigkenisston | last post by:
In asp.net 1.x we used something like DataBinder.Eval(Container.DataItem, "FieldName") for binding data. Now, in asp.net 2.0 I see a lot of "Eval( fieldname )" and not the older format. I guess they are equivalent, but I can't find information about the difference. I suspect the new Eval does not work exactly the way the old DataBinder.Eval used to work.
0
9568
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
9398
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
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
9951
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
9832
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
8831
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7375
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
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.