我正在使用带有 Asp.net Webforms 的 twitter 引导模式。
事件单击按钮btnSubmit后,模式消失。
如何保持模态活跃?
示例.aspx:
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<asp:TextBox ID="txtMessage" runat="server"></asp:TextBox>
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<asp:Button CssClass="btn btn-primary" ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
示例.aspx.cs
protected void btnSubmit_Click(object sender, EventArgs e)
{
txtMessage.Text = "Success!";
}