简体   繁体   English

使用JavaScript在ASP.NET中进行事件触发

[英]Event Triggering in asp.net using javascript

I've created two buttons using javascript; 我创建使用JavaScript两个按钮; yes and no. 是的,没有。 I need to get the event triggered when the button is clicked. 我需要在单击按钮时触发事件。

ie.. onclick=getvalue(). 即.. onclick = getvalue()。

public void SetYesButton(string msg_button_class) {
    this.msgbox_Yes_button = "<input type=\"button\" value=\"Yes\" class=\"" + msg_button_class + "\" onClick=\"getvalue()\";>";
}

public void SetNoButton(string msg_button_class) {
    this.msgbox_No_button = "<input type=\"button\" value=\"No\" class=\"" + msg_button_class + "\" onClick=\"document.getElementById('pagedimmer').style.visibility = 'hidden'; document.getElementById('msgbox').style.visibility = 'hidden';\">";
}

Didn't understand your question, but a suggestion. 不明白您的问题,只是一个建议。

Remove the penultimate semi-colon: 除去倒数第二分号:

"<input type=\"button\" value=\"Yes\" class=\"" + msg_button_class + "\" onClick=\"getvalue()\">"; 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM