M
Mike Lerch
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.DataItem, "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
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.DataItem, "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