您的位置:首页 > 娱乐 > 明星 > 2021年最新企业所得税政策_泰安新闻联播_seo网络营销招聘_sem竞价培训班

2021年最新企业所得税政策_泰安新闻联播_seo网络营销招聘_sem竞价培训班

2025/6/30 23:06:47 来源:https://blog.csdn.net/2302_81910218/article/details/146448017  浏览:    关键词:2021年最新企业所得税政策_泰安新闻联播_seo网络营销招聘_sem竞价培训班
2021年最新企业所得税政策_泰安新闻联播_seo网络营销招聘_sem竞价培训班

1、在aspx中添加,将依赖添加进来

 <link rel="stylesheet" href="Content/bootstrap.min.css" /><script src="Scripts/jquery-3.7.0.min.js"></script><script src="Scripts/bootstrap.min.js"></script>

2、添加模态对话框的div

<!-- 添加对话框 -->
<div class="modal fade" id="AddModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="AddModalLabel">Modal title</h5><button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button></div><div class="modal-body">...</div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button><button type="button" class="btn btn-primary">Save changes</button></div></div></div>
</div>

3、我封装了两个C#函数来显示和隐藏bootstrp的对话框

public void showModal(string id)
{string script = "var myModal = new bootstrap.Modal(document.getElementById('" +id +"'), {\r\n  keyboard: false\r\n});" +"myModal.show()";ClientScript.RegisterStartupScript(this.GetType(), "alert", script, true);
}public void hideModal(string id)
{string script = "var myModal = new bootstrap.Modal(document.getElementById('" +id +"'), {\r\n  keyboard: false\r\n});" +"myModal.hide()";ClientScript.RegisterStartupScript(this.GetType(), "alert", script, true);
}

这样调用

protected void BtnAdd_Click(object sender, EventArgs e)
{// 弹框获取信息showModal("AddModal");
}

至于获取数据其他的就要交给你去将aspx中的对话框部分,稍作修改,将button改成asp:Button这样来获取数据,加油!!!

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com