摘要:如何動態增加 RadioButtonList 的onClick事件
問題:
我想動態增加 asp:RadioButtonList 的onClick事件去執行某個自訂的JavaScript函數
該如何寫
解答:
在page_load裡:
RadioButtonList1.Attributes.Add("onclick", "todo()");
在aspx裡:
<script>
function todo() {
alert("test");
}
</script>
來源:
摘要:如何動態增加 RadioButtonList 的onClick事件
問題:
我想動態增加 asp:RadioButtonList 的onClick事件去執行某個自訂的JavaScript函數
該如何寫
解答:
在page_load裡:
RadioButtonList1.Attributes.Add("onclick", "todo()");
在aspx裡:
<script>
function todo() {
alert("test");
}
</script>
來源: