开发者

How to change td content dynamically?

I have to change td content dynamically that depends on checkbox. If checkbox isnot checked td will not take an extra style but if checked my text must take such a style:

b style="font-family:Tahoma;font-size:8pt;color:#0f0000;font-weight:normal;">My Text</b

Mycode is 开发者_如何学Pythonlike that:

asp:DataList ID="Inside" runat="server" RepeatColumns="4"

ItemTemplate

  <asp:HiddenField ID="FeaID2" runat="server" Value='<%#DataBinder.Eval(Container.DataItem, "FeatureID")%>' >

    <td class="checkbox_td"><input disabled="disabled" type="checkbox" <%# int.Parse(DataBinder.Eval(Container.DataItem, "exist").ToString()) > 0 ? "checked" : "" %> /></td>

    <td class="text_td">!!!HERE IS MY PROBLEM!!!</td>

/ItemTemplate

/asp:DataList

I use C#, So, How do i give extra style to td content dynamically that i call (HERE IS MY PROBLEM) that depends on checkbox below?


Add another selector to you CSS:-

td.text_td_checked { font-family:Tahoma;font-size:8pt;color:#0f0000;font-weight:normal; }

Make sure it comes after the text_td selector in your CSS. In your TD :-

<td class="text_td <%# int.Parse(DataBinder.Eval(Container.DataItem, "exist").ToString()) > 0 ? "text_td_checked" : "" %>">!!!Problem Solved!!!</td>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜