I am trying to create an appointment template with an image and a hyperlink. I need the image and hyperlink URLs to be retrieved from custom attributes. I am currently using asp ImageButton and hyperlink controls to do this, but I am having trouble formatting the tags to retrieve the URLs.
My template is as follows:
<AppointmentTemplate>
<div>
<table id="mainTable" cellspacing="0" cellpadding="0" border="0" frame="void">
<tr>
<td width="20">
<asp:ImageButton runat="server" ID="detailsButton" ImageUrl=<%# Eval("Attributes['DetailsIconURL']") %>
AlternateText='Show Details' />
</td>
<td>
<asp:HyperLink ID='LinkButton' Font-Underline="true" ToolTip=<%# Eval("Attributes['ToolTip']") %> NavigateUrl=<%# Eval("Attributes['NavigateURL']") %>
Font-Name="Arial" runat="server" Font-Size="8pt" Font-Names="Arial,Tahoma,Verdana" Text='<%# Bind("Subject")%>'>
</asp:HyperLink>
</td>
</tr>
</table>
</div>
</AppointmentTemplate>
2 questions:
1. How do I define and set custom attributes in codebehind?
2. How do I assign the custom attribute values (URLs in this case) to control attributes in asp control tags?