Abstract code from HTML

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I'm going through some samples in a book of mine about Data controls. Some
of the examples though contain code embedded within the html, something I'd
like to avoid.

Can someone look at this and tell me how I could do this from a codebehind
page, not the HTML

<asp:datalist id="test" runat="server">
<ItemTemplate>
<%# Container.DataItem %>
</ItemTemplate>
</asp:datalist>

As you can see the line I'm interested in getting rid of is <%#
Container.DataItem %>

Any thoughts?

--Michael
 
Any reason you would like to avoid that? That's one of the most powerful
features of the DataControls - the main reason to use them. Otherwise you
end up doing everything manually...
 
Well I do not want to do away with that capability, I'm just wondering if
there is a way I can do it from my codebehind pages. It is kind of like the
old asp way of doing things, and doesn't really separate code from html.
 
Back
Top