簡體   English   中英

需要為ASP.net文本框添加keydown事件,並需要使用keydown事件觸發codebehind函數

[英]Need to add keydown event for ASP.net Text box and need to trigger a codebehind function using the keydown event

頁面加載事件:

txtName.Attributes.Add("onkeyup", "return doDataListBind()");`

Javascript:

function doDataListBind()
{
   document.getElementById("Button2").click();
}

創建了一個按鈕,並嘗試使用JavaScript觸發點擊事件。

在jQuery中:

$( "#Button2" ).trigger( "click" );

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM