i am using asp button control to call a javascript function. but it is not working. it is showing an error i am calling javascript function as:
<asp:button ID="Button1" runat="server" Text="Button" onclick="rock()" />
j印功能如下:
function rock() {
var username = prompt("what is your name?", "please enter your name here");
if (username) {
alert("nice to meet you," + username + ".");
}
}
is there any way to call javascript function on asp button?