[問題]ListItem不支援Attributes, 有其他解決方案嗎 ?
我面臨一個問題就是使用CheckBoxList的時候
想要在每個Item加上onmouseover的屬性
CBL.Items[0].Attributes.Add("onmouseover","aaa()");
但是查網頁卻沒寫進去
後來查文件才知道不支援這個屬性
於是我改用Repeater來做
在<ItemTemplete>區間裡加入
<asp:CheckBox id="li" Text='<%...%>'></CheckBox>
可是我要用
CheckBox cb=(CheckBox)Repeater1.FindControl("xxx");
(註:xxx即複製檢視原始碼的該CheckBox的id)
卻抓不到CheckBox
請問我該怎麼解決
或者有辦法解決不支援Attributes的問題
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.66.175.152
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章
14
23