Javascript 带有代码隐藏的Jquery模式
我有个问题。 在asp.net中,我想用下面的代码运行模式弹出窗口。但我的研究并不十分成功 您认为我应该如何实施流程Javascript 带有代码隐藏的Jquery模式,javascript,jquery,asp.net,modal-dialog,bootstrap-modal,Javascript,Jquery,Asp.net,Modal Dialog,Bootstrap Modal,我有个问题。 在asp.net中,我想用下面的代码运行模式弹出窗口。但我的研究并不十分成功 您认为我应该如何实施流程 <script type="text/javascript"> function showAjaxModal() { jQuery('#Modal_Alert').modal('show', { backdrop: 'static' }); } </script> <div class="modal fade" id
<script type="text/javascript">
function showAjaxModal() {
jQuery('#Modal_Alert').modal('show', { backdrop: 'static' });
}
</script>
<div class="modal fade" id="Modal_Alert">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">
<asp:Label runat="server" ID="LblAlertHeader"></asp:Label></h4>
</div>
<div class="modal-body">
<asp:Label runat="server" ID="LblAlertBody"></asp:Label>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>
<%--<button type="button" class="btn btn-info">Save changes</button>--%>
</div>
</div>
</div>
</div>
代码正在运行此
<a href="javascript:;" onclick=" showAjaxModal(); " class="btn btn-default" >Show Me</a>
请提供帮助。在“代码隐藏”中单击添加此按钮
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "key", "showAjaxModal()", true);
使用下面的代码,它将工作
函数showAjaxModal(){
jQuery('#Modal_Alert').Modal('show',{background:'static'});
返回false;
}
请分享服务器端代码,您正在尝试在客户端运行一些js代码…母版页中的第一个html代码在用户控制中尝试您的代码如何做?谢谢您的回答,但是;我想要隐藏代码,因为运行其他服务器端代码,如果(true){//open modal}或者{//open modal}Hi Turgay ACAR,请使用下面的代码保护void BtnKaydet_Click(对象发送方,事件参数e){Page.ClientScript.RegisterStartupScript(this.GetType(),“OpenModel”,“javascript:showAjaxModal();”);)
protected void BtnKaydet_Click(object sender, EventArgs e)
{ //openmodal; }
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "key", "showAjaxModal()", true);
<script type="text/javascript">
function showAjaxModal() {
jQuery('#Modal_Alert').modal('show', { backdrop: 'static' });
return false;
}
</script>
<asp:Button ID="BtnKaydet" runat="server" UseSubmitBehavior="false" OnClientClick="return showAjaxModal();" />