I have customized my AppointmentTemplate by adding some controls (Labels and ImageButtons).
I need to access those controls to change values based on info I have in my Appointment object.
My first approach was just using Eval() to toggle the visibility of a LinkButton in the markup based on a custom attribute like this:
<AppointmentTemplate>
<p>
<h2><%# Eval("Subject") %></h2><br />
</p>
<p>
<h3><%# string.IsNullOrEmpty(Eval("Attributes['gst_name']").ToString().Trim()) ? "" : "with: " + Eval("Attributes['gst_name']") %></h3>
</p>
<p>
<asp:ImageButton id= "ibNotes" ImageUrl="~/Images/note.png" runat="server" CommandName="GetNote" Visible = "<%# Eval("Attributes['notelength']") = "0" ? "false" : "true" %>"/>
</p>
<p>
<h3>AppointmentTemplate<%# Eval("Attributes['modifiers']") %></h3>
</p>
</AppointmentTemplate>
But I can't build with it this way. I get an error: "The server tag is not well formed." Referring to my ImageButton location.
So I tried another approach, to get to it in codebehind, but I can't get anything working there either.
What server side event should I use? I'm thinking I'd need to use FindControl() but can't find anything in Intellisense.
Anyone got an example?
Thanks!
Matt
I need to access those controls to change values based on info I have in my Appointment object.
My first approach was just using Eval() to toggle the visibility of a LinkButton in the markup based on a custom attribute like this:
<AppointmentTemplate>
<p>
<h2><%# Eval("Subject") %></h2><br />
</p>
<p>
<h3><%# string.IsNullOrEmpty(Eval("Attributes['gst_name']").ToString().Trim()) ? "" : "with: " + Eval("Attributes['gst_name']") %></h3>
</p>
<p>
<asp:ImageButton id= "ibNotes" ImageUrl="~/Images/note.png" runat="server" CommandName="GetNote" Visible = "<%# Eval("Attributes['notelength']") = "0" ? "false" : "true" %>"/>
</p>
<p>
<h3>AppointmentTemplate<%# Eval("Attributes['modifiers']") %></h3>
</p>
</AppointmentTemplate>
But I can't build with it this way. I get an error: "The server tag is not well formed." Referring to my ImageButton location.
So I tried another approach, to get to it in codebehind, but I can't get anything working there either.
What server side event should I use? I'm thinking I'd need to use FindControl() but can't find anything in Intellisense.
Anyone got an example?
Thanks!
Matt