使用C#代码动态调用Bootstrap Alert框 [英] Dynamically Call Bootstrap Alert box using C# code

查看:108
本文介绍了使用C#代码动态调用Bootstrap Alert框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在没有MVC的c#.net中动态调用带有警报消息和警报类型和超时的Bootstrap Alert框。

怎么做?



我的JavaScript代码是

I want to call Bootstrap Alert box with alert message and alert type and timeout dynamically in c#.net without MVC.
How to do it?.

My JavaScript Code Is

function showalertmsg(message, alerttype) {

        $('#alert_placeholder').append('<div id="alertdiv" class="alert ' + alerttype + '"><a class="close" data-dismiss="alert">×</a><span>' + message + '</span></div>')

        setTimeout(function () {
            $("#alertdiv").remove();

        }, 5000);
}









如何传递消息,alerttype点击提交按钮时的Javascript。并且它没有回发完成?





How To Pass Message, alerttype to Javascript when i click Submit Button. And It Done Without Postback?

推荐答案

('#alert_placeholder')。append('< < span class =code-leadattribute> div id = alertdiv class = alert'+ alerttype +' > < a class = close < span class =code-attribute> data-dismiss = alert > ×< / a > < span > '+ message +'< / span > < / div > ')

setTimeout(function(){
('#alert_placeholder').append('<div id="alertdiv" class="alert ' + alerttype + '"><a class="close" data-dismiss="alert">×</a><span>' + message + '</span></div>') setTimeout(function () {


(#alertdiv)。remove();

},5000);
}
("#alertdiv").remove(); }, 5000); }









如何传递消息,alerttype点击提交按钮时的Javascript。并且它没有回发完成?





How To Pass Message, alerttype to Javascript when i click Submit Button. And It Done Without Postback?


请参阅 http://getbootstrap.com/javascript/ [ ^ ]。


这篇关于使用C#代码动态调用Bootstrap Alert框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆