Jump to content

Trouble Using A Button With The Repeater Ctrl


texagg99

Recommended Posts

Help!! How do Cast this correctly?I have gotten all the Container.DataItems to work except the one for the BackColor. Text works fine with the single quotes around it. And the Span likes the Left and top values. But BackColor complains that "InvalidCastException was unhandled by usercode: Specified cast is not valid."I am trying to avoid the overhead of code behinds, so here is my code.

      <asp:Repeater ID="rpt_EOM_Chart" runat="server"  DataSourceID="SqlDataSource_ChartEOM">                 <ItemTemplate>            <span style="position:absolute; left:<%#Container.DataItem("IMG_POS_LEFT")%>; top:<%#Container.DataItem("IMG_POS_TOP")%>;">                      <asp:Button  Text='<%#Container.DataItem("NAME")%>' CssClass='<%#Container.DataItem("NAME")%>'                    runat="server" BorderStyle="Solid" Font-Bold="True" Font-Size="x-Small"                       OnClick="SetEOMView" BackColor=<%#Container.DataItem("TASK_STATUS_COLOR")%> />            </span>         </ItemTemplate>      </asp:Repeater>

Link to comment
Share on other sites

ASP has actually been superseded - you are much better off learning ASP.NET.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...