当前位置: 首页> 健康> 科研 > 企业网页建设公司咨询电话_b2c跨境电子商务平台有哪些?_保定seo推广_网站推广方案有哪些

企业网页建设公司咨询电话_b2c跨境电子商务平台有哪些?_保定seo推广_网站推广方案有哪些

时间:2025/7/10 10:07:35来源:https://blog.csdn.net/2302_81910218/article/details/146448017 浏览次数:0次
企业网页建设公司咨询电话_b2c跨境电子商务平台有哪些?_保定seo推广_网站推广方案有哪些

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这样来获取数据,加油!!!

关键字:企业网页建设公司咨询电话_b2c跨境电子商务平台有哪些?_保定seo推广_网站推广方案有哪些

版权声明:

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

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

责任编辑: