復制代碼 代碼如下:
<!--創建一個JS調用button的click事件-->
<script type="text/javascript">
function JsListChangeItem() {
document.getElementById("buttonShow").click();
}
</script>
<!--創建一個隱藏的button,創建雙擊事件--->
<asp:Button runat="server" Text="Button"/>
<!--實現雙擊的listbox-->
<asp:ListBox runat="server"Height="226px" AutoPostBack="True"></asp:ListBox>
復制代碼 代碼如下:
protected void Page_Load(object sender, EventArgs e)
{
listBox1.Attributes.Add("ondblclick", "JsListChangeItem()");//為listBox1添加雙擊事件。
}
新聞熱點
疑難解答
圖片精選