Hi team,
I have build one Rotator programaticaly implemented as Todd Anglin blog sample with ItemTemplate as Itemplate implementation. My problem is that my item template is rended as "Text" <%# Container.DataItem %> in place to be evaluated. Could you suggest some solution to be able to evaluate the content inside my rotator using codebehind.
In my case i use one List<string> item that work perfect in static code as
<ItemTemplate>
<%# Container.DataItem %>
</ItemTemplate>
Many thanks, Romi
I have build one Rotator programaticaly implemented as Todd Anglin blog sample with ItemTemplate as Itemplate implementation. My problem is that my item template is rended as "Text" <%# Container.DataItem %> in place to be evaluated. Could you suggest some solution to be able to evaluate the content inside my rotator using codebehind.
| C# as codebehind |
| ... |
| Rot.ItemWidth = Unit.Pixel(300); |
| Rot.ItemHeight = Unit.Pixel(200); |
| Rot.ItemTemplate =new RotatorTemplate() ; |
| ... |
| public class RotatorTemplate : ITemplate |
| { |
| #region ITemplate Membres |
| public void InstantiateIn(System.Web.UI.Control container) |
| { |
| LiteralControl lc1 = new LiteralControl("<%# Container.DataItem %>"); |
| container.Controls.Add(lc1); |
| } |
| #endregion |
| } |
In my case i use one List<string> item that work perfect in static code as
<ItemTemplate>
<%# Container.DataItem %>
</ItemTemplate>
Many thanks, Romi