按钮单击事件在asp.net mvc4中不起作用?

时间:2014-04-19 20:06:13

标签: asp.net-mvc asp.net-mvc-4

我有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"  />

0 个答案:

没有答案