为什么弹出窗口没有显示使用mvc5 [英] Why popup window is not showing using mvc5
本文介绍了为什么弹出窗口没有显示使用mvc5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试显示一个弹出窗口,列出从列表页面中选择特定记录的记录列表。但弹出窗口没有显示。请帮帮我。
提前谢谢。
以下是我的代码
----- ---------
Hi,
I am trying to show a popup window for list of records for select a particular record from a list page. But popup window is not showing. Please help me.
Thank you in advance.
below is my code
--------------
<h4>Departments</h4>
<a class="btn btn-success" data-toggle="modal" data-target=".DepartmentViewModel">
<span class="glyphicon glyphicon-eye-open"></span>View
</a>
<div class="modal fade DepartmentViewModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button data-dissmiss="modal" class="close"><span>×</span> </button>
<div class="modal-title">My modal</div>
</div>
<div class="modal-body">
<img src="~/Content/images/Desert.jpg" />
<p>
Some text here or Add fields here..
</p>
</div>
<div class="modal-footer">
<button class="btn btn-primary">Submit</button>
<button class="btn btn-default" data-dissmiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
我尝试过:
请帮帮我。
非常感谢你。
What I have tried:
Please help me.
Thank You very much in Advance.
推荐答案
假设你'重新使用引导程序 [ ^ ],data-target
属性需要是模态对话框元素的ID。你不能使用通用的jQuery选择器,因为它可以匹配多个元素。
Assuming you're using Bootstrap[^], thedata-target
attribute needs to be the ID of the modal dialog element. You can't use a generic jQuery selector, as that could match multiple elements.
<h4>Departments</h4>
<a class="btn btn-success" data-toggle="modal" data-target="#DepartmentViewModel">
<span class="glyphicon glyphicon-eye-open"></span>View
</a>
<div class="modal fade" id="DepartmentViewModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button data-dissmiss="modal" class="close"><span>×</span> </button>
<div class="modal-title">My modal</div>
</div>
<div class="modal-body">
<img src="~/Content/images/Desert.jpg" />
<p>
Some text here or Add fields here..
</p>
</div>
<div class="modal-footer">
<button class="btn btn-primary">Submit</button>
<button class="btn btn-default" data-dissmiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
有关 BootStrap模式 [ ^ ]
Refer this for complete documentation on BootStrap Modal[^]
data-dissmiss="modal" // spell error
更改为
data-dismiss="modal"
保存按钮
,你将拥有将事件映射到它并在事件内关闭弹出窗口。
参考引导模式保存按钮单击和关闭 [ ^ ]
>
这篇关于为什么弹出窗口没有显示使用mvc5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文