2016-01-31 92 views
0

我在我的Home.asp上打开了一个模式的登录按钮。我有另一个页面有一个登录/注销按钮。我怎样才能从这个页面上的主页调用模态。如何从另一个页面打开引导模式?

首页。 ASPX代码:

<a href="#" data-target="#ModalCLogin" data-toggle="modal"><span class="glyphicon glyphicon-log-in"></span>&nbsp;Login</a></li> 

第二页代码:(这里点击这个链接我想从Home.aspx调用模式)

<a href="#" data-target="#ModalCLogin" data-toggle="modal"><span class="glyphicon glyphicon-log-in"></span>&nbsp;Login</a> 

回答

1

调用模式的ID在你的其他页面。

模态在Home.aspx:

<div id="HomeModalId" data-width="500" data-backdrop="static"> Modal Content </Div> 

在你的第二个页面,链接会是这样。

<a href="Home.aspx/#HomeModalId" data-target="#ModalCLogin" data-toggle="modal"><span class="glyphicon glyphicon-log-in"></span>&nbsp;Login</a></li> 
+0

它不工作 – Ash

1

我有同样的问题,我在this link找到解决方案。 比方说,你有2页,

  • First.html - >包含一个锚模态

  • Second.html - >包含你的模式

定义

基本上你需要href你的模态在“Second.html”中的位置和数据目标你模态的ID

<li><a href="Second.html" data-target="#theModal" data-toggle="modal">Lab 6</a></li> 

然后仍然在你的First.html您需要定义与ID模态,直到模式内容

<div class="modal fade text-center" id="theModal"> 
<div class="modal-dialog"> 
    <div class="modal-content"> 
    </div> 
</div> 
</div> 

在Second.html你定义什么是里面的莫代尔内容

<div class="modal-header"> 
    ... 
</div> 
<div class="modal-body"> 
    ... 
</div> 
<div class="modal-footer"> 
    ... 
</div> 

它为我工作。所有学分去Buzinas谁回答这个问题上我提供以上链接

相关问题