我如何处理Bootstrap中的警报消息 [英] How I Do Handle Alert Message In Bootstrap
问题描述
我有一个Web应用程序,我有不同的表单来获取用户的输入,当用户按下保存按钮时,使用site.master中的代码显示按摩
i have a web application in which i have different form to get input from user,when user press save button a massage is displayed using this code in the site.master
<asp:UpdatePanel runat="server">
<contenttemplate>
<asp:Literal runat="server" ID="_alert">
<asp:ContentPlaceHolder runat="server" ID="MainContent">
</contenttemplate>
并使用以下脚本代码:
and using script code as follow:
$(".alert").alert('close');
如果我使用此代码则没有显示错误或成功消息,只显示所有字段并准备好下次输入。
如果我使用(_alert),则显示消息但不隐藏。我希望在每个条目消息显示并在几秒后消失,表格准备好下一个entry.plz帮助我
if i use this code then there is no error or successful message is displayed ,just all fields clear and ready for next entry.
and if i use (_alert) instead then message is displayed but it does not hide. i want that on each entry message is displayed and vanished after few second and form is ready for next entry.plz help me out
推荐答案
(。alert)。 alert('close');
(".alert").alert('close');
如果我使用此代码,则表示没有错误或显示成功消息,只清除所有字段准备下次进入。
如果我使用(_alert)而不是显示消息,但它不会隐藏。我希望在每个条目消息显示并在几秒后消失,表格准备好下一个条目.plz帮助我
if i use this code then there is no error or successful message is displayed ,just all fields clear and ready for next entry.
and if i use (_alert) instead then message is displayed but it does not hide. i want that on each entry message is displayed and vanished after few second and form is ready for next entry.plz help me out
您可以利用data-dismiss属性。
如下所示
You can take the advantage of "data-dismiss" attribute.
like as below
<div id="ANY" style="display: none; width: 700px;" class="modal hide fade in">
<div class="modal-header modal_header_back">
<a class="close" id="aClose" data-dismiss="modal">×</a>
<h4>Any</h4>
</div><br />
<div id="ANY" class="modal-container-padding issueDetailsContainer">
//content here..
</div>
</div>
您可以触发收盘价:
You can trigger the close by:
//add delay if required..
(#aClose)。触发器('click');
("#aClose").trigger('click');
希望这有帮助
谢谢
:)
Hope this helps
Thanks
:)
这篇关于我如何处理Bootstrap中的警报消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!