我遇到了一个问题,即从代码后端设置我的框架src以在单击按钮时在我的模态中使用。frame src正在获取值,但未在模态中显示页面。 模态代码:
<div class="modal fade " id="modal-info" role="dialog" data-keyboard="false" style="border: none; height: 500px;" >
<div class="modal-dialog col-md-push-1">
<!-- Modal content-->
<div class="modal-content" style="width: 700px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Set Leave</h4>
</div>
<div class="modal-body">
<iframe id="frm" runat="server" width="96.6%" style="border: none; height: 300px;"></iframe>
</div>
<div class="modal-footer">
<button type="button" id="Button2" class="btn btn-primary" data-dismiss="modal" runat="server" onserverclick="close_ServerClick">OK</button>
</div>
</div>
</div>
</div>
然后在代码背后,当按钮被点击时
frm.Src = "../Popups/staff_leave_calender.aspx";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "", "$('#modal-info').modal();", true);
只有在页面加载时设置了框架的源src,它才能正常工作。
protected void Page_Load(object sender, EventArgs e)
{
frameinfo.Src = "../Popups/staff_leave_calender.aspx";
}
我需要做一些类似的事情:
Session["leaveid"] = StrID;
frameinfo.Src = "../Popups/staff_leave_calender.aspx?lvv=" + StrID;
在模态框中加载的页面中将使用 Str ID。其他选项或其他可做的事情是什么。