我有asp按钮(在mvc4中),我想在按钮点击事件(使用ASPX视图引擎)上执行服务器端代码,但点击事件不起作用。我的代码在Index.aspx中,如
<script runat="server">
Protected Sub BtSend_Click(sender As Object, e As EventArgs)
text_mess.Value = Nothing
ScriptManager.RegisterStartupScript(Me, [GetType](), "showalert", "alert('Message Sent');", True)
End Sub
</script>
<textarea id="text_mess" runat="server" name="text_mess" draggable="false">
Message
</textarea>
<br />
<asp:Button CssClass="login-submit" ID="BtSend" runat="server" Text="Send"
OnClick="BtSend_Click" />