@{
Layout = null;
}
<!DOCTYPE html>
@using CMS.Models
@using CMS.Common
<html>
<head>
<meta name="viewport" content="width=device-width" />
<script src="~/Scripts/jquery-1.8.2.js"></script>
<script src="~/Scripts/jquery.easyui.min.js"></script>
<script src="~/Scripts/easyui-lang-zh_CN.js"></script>
<link href="~/Content/themes/icon.css" rel="stylesheet" />
<link href="~/Content/themes/default/easyui.css" rel="stylesheet" />
<script type="text/javascript">
$(function(){
$("#detailDiv").css("display", "none");
$(".details").click(function () {
Showdetil($(this).attr("ids"));
});
});
function Showdetail(id) {
$.post("/AdminNewsList/GetNewInfoModel", { "id": id }, function (data) {
$("#Title").text(data.Title);
$("#auther").text(data.Auther);
$("#SubDateTime").text(data.SubDateTime);
$("#Msg").text(data.Msg);
});
$("#detailDiv").css("display", "block");
$('#detailDiv').dialog({
modal: true,
resizable: true,
maximizable: true,
collapsible: true,
title: "新闻详细",
width: 400,
height:300,
buttons:[{
text: 'Ok',
iconCls: 'icon-ok',
handler: function () {
alert('ok');
}
}, {
text: 'Cancel',
handler: function () {
$('#detailDiv').dialog('close');
}
}]
}); }
</script>
<title>Index</title>
</head>
<body>
<div>
@if(ViewData["NewsList"] != null)
{
<table>
<tr>
<th>编号</th>
<th>标题</th>
<th>作者</th>
<th>时间</th>
<th>详细</th>
</tr>
@foreach (NewsInfo newsinfo in (List<NewsInfo>)ViewData["NewsList"])
{
<tr>
<td>@newsinfo.Id</td>
<td>@newsinfo.Title</td>
<td>@newsinfo.Auther</td>
<td>@newsinfo.SubDateTime</td>
<td><a href="javascript:void(0)" class="details" ids="@newsinfo.Id">详细</a></td>
</tr>
}
</table>
@MvcHtmlString.Create(Pagebar.GetPagebar((int)ViewData["PageIndex"],(int)ViewData["PageCount"]))
}
else
{
<span>暂无数据</span>
}
</div>
<!----------详细DIV开始----------->
<div id="detailDiv">
<table>
<tr>
<td>标题</td><td><span id="Title"></span></td>
</tr>
<tr>
<td>作者</td>
<td><span id="auther"></span></td>
</tr>
<tr>
<td>时间</td>
<td><span id="SubDateTime"></span></td>
</tr>
<tr>
<td>内容</td>
<td><span id="Msg"></span></td>
</tr>
</table> </div> <!------------详细结束-------------->
</body>
</html>
GetNewInfoModel已经在控制其中写有方法
Layout = null;
}
<!DOCTYPE html>
@using CMS.Models
@using CMS.Common
<html>
<head>
<meta name="viewport" content="width=device-width" />
<script src="~/Scripts/jquery-1.8.2.js"></script>
<script src="~/Scripts/jquery.easyui.min.js"></script>
<script src="~/Scripts/easyui-lang-zh_CN.js"></script>
<link href="~/Content/themes/icon.css" rel="stylesheet" />
<link href="~/Content/themes/default/easyui.css" rel="stylesheet" />
<script type="text/javascript">
$(function(){
$("#detailDiv").css("display", "none");
$(".details").click(function () {
Showdetil($(this).attr("ids"));
});
});
function Showdetail(id) {
$.post("/AdminNewsList/GetNewInfoModel", { "id": id }, function (data) {
$("#Title").text(data.Title);
$("#auther").text(data.Auther);
$("#SubDateTime").text(data.SubDateTime);
$("#Msg").text(data.Msg);
});
$("#detailDiv").css("display", "block");
$('#detailDiv').dialog({
modal: true,
resizable: true,
maximizable: true,
collapsible: true,
title: "新闻详细",
width: 400,
height:300,
buttons:[{
text: 'Ok',
iconCls: 'icon-ok',
handler: function () {
alert('ok');
}
}, {
text: 'Cancel',
handler: function () {
$('#detailDiv').dialog('close');
}
}]
}); }
</script>
<title>Index</title>
</head>
<body>
<div>
@if(ViewData["NewsList"] != null)
{
<table>
<tr>
<th>编号</th>
<th>标题</th>
<th>作者</th>
<th>时间</th>
<th>详细</th>
</tr>
@foreach (NewsInfo newsinfo in (List<NewsInfo>)ViewData["NewsList"])
{
<tr>
<td>@newsinfo.Id</td>
<td>@newsinfo.Title</td>
<td>@newsinfo.Auther</td>
<td>@newsinfo.SubDateTime</td>
<td><a href="javascript:void(0)" class="details" ids="@newsinfo.Id">详细</a></td>
</tr>
}
</table>
@MvcHtmlString.Create(Pagebar.GetPagebar((int)ViewData["PageIndex"],(int)ViewData["PageCount"]))
}
else
{
<span>暂无数据</span>
}
</div>
<!----------详细DIV开始----------->
<div id="detailDiv">
<table>
<tr>
<td>标题</td><td><span id="Title"></span></td>
</tr>
<tr>
<td>作者</td>
<td><span id="auther"></span></td>
</tr>
<tr>
<td>时间</td>
<td><span id="SubDateTime"></span></td>
</tr>
<tr>
<td>内容</td>
<td><span id="Msg"></span></td>
</tr>
</table> </div> <!------------详细结束-------------->
</body>
</html>
GetNewInfoModel已经在控制其中写有方法
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货