Here is my code-behind, this adds the "OakTreeName" to the datarepeater. There's about 200 of them.
Dim cmd As New SqlClient.SqlCommand("OakTree_Load", New SqlClient.SqlConnection(ConnStr))
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection.Open()
Dim datareader As SqlClient.SqlDataReader = cmd.ExecuteReader()
OakTree_Thumb_Repeater.DataSource = datareader
OakTree_Thumb_Repeater.DataBind()
cmd.Connection.Close()
Here is essentially what I'd like to do with my markup:
<ContentTemplate>
<asp:Repeater ID="OakTree_Thumb_Repeater" runat="server">
<ItemTemplate>
<asp:ImageButton ImageUrl="<%# Container.DataItem("OakTreeName") %>" AlternateText="" runat="server" />
<!-- Or I'd like to do it this way by adding a custom variable to the data repeater -->
<asp:ImageButton ImageUrl="<%# Container.DataItem("OakTreeThumbURL") %>" AlternateText="" runat="server" />
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
I would like to manipulate the "OakTreeName" variable before it gets placed into the item template. Basically I need to manipulate the "OakTreeName" variable and then input it as the ImageURL for the imagebutton within the item template. How do I do this?
Am I approaching this wrong? Is there a way to manipulate the item template from code-behind before it gets displayed for each round of variables in the data repeater?