I am studying the book ASP.NET Data Web Controls. Very interesting, and
I try to put everything in runtime (VB.NET) code instead of in the
page. I got very far but now I am stuck.
I found examples of how to create a TemplateColumn in a DataGrid with a
hyperlink with two parameters at runtime
(http://www.c-sharpcorner.com/Code/20...namically.asp).
But now I want to create a templatecolumn in a datalist with some
htmltext, a dataitem (datafield), an imagebutton and a seperator.
Googling didn't provide me with an answer, apperently when you want to
do this kind of stuff you have to resort to messing around in asp.
The code for the asp-page is:
<form runat="server">
<asp:DataList runat="server" id=dlTitles">
<ItemTemplate>
<strong>Title:</strong<%# DataBinder.Eval(Container.DataItem,
"title") %>
<br />
<asp:ImageButton runat="server" id="btnDetails"
AlternateText="View Book Details" ImageUrl="details.gif" />
</ItemTemplate>
<SeparatorTemplate>
<hr />
</SeparatorTemplate>
<asp:DataList>
</form>
but I want to transorm this into VB.NET runtime code.
Reason is I am learning to make webpages with VB.NET, not with asp. I
think it is better to keep your code together. I am using Visual Studio
2002. I hope it is possible, if it ain't it doesn't give a very mature
impression of VB.NET as webdevelopment environment when you have to
resort to asp occasionally.
Pugi!