Re: [問題] RadioButtonList改變字型顏色
※ 引述《testcrack (testcrack)》之銘言:
: RadioButtonList中的ListItem欲改變字型顏色,我的方法是:
: <asp:ListItem Value="E01"><font color =blue>無訊號</font></asp:ListItem>
: <asp:ListItem Value="E02"><font color =red>網路斷線</font></asp:ListItem>
: :
: :
: 但是我有做SelectedIndexChanged的事件
: 要取得Text的資料,結果連font的標籤都取得
: 請問有什麼比較好的方法可以指定某些ListItem改顏色,而且可取得正確內容
我的方法
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem Value="E01" Text="無訊號" style="color: blue;"></asp:ListItem>
<asp:ListItem Value="E02" Text="網路斷線" style="color: red;"></asp:ListItem>
</asp:RadioButtonList>
程式寫法(C#)
RadioButtonList1.Items[0].Attributes["style"] = "color:blue";
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 59.120.159.50
推
11/25 16:27, , 1F
11/25 16:27, 1F
→
11/25 16:32, , 2F
11/25 16:32, 2F
推
11/25 18:03, , 3F
11/25 18:03, 3F
→
11/25 18:06, , 4F
11/25 18:06, 4F
→
11/25 18:31, , 5F
11/25 18:31, 5F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):