1、MVC控制器
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WebApplication37_MVC.Controllers
{
public class DefaultController : Controller
{
// GET: Default
public ActionResult Index()
{
return View();
}
public ActionResult Add(int id)
{
ViewBag.Id = id;
return View();
}
public ActionResult Info()
{
return View();
}
public ActionResult fh()
{
return View();
}
}
}
2、Index视图
@{
ViewBag.Title = “Index”;
}
Index
<tr>
<td>类型</td>
<td>名称</td>
<td>信息</td>
<td>审核</td>
<td>操作</td>
</tr>
<tbody id="tb"></tbody>
<tr>
<td>总共<span id="totalCount"></span>条数据</td>
<td>第<span id="currentPage"></span>页</td>
<td>共<span id="totalPage"></span>页</td>
<td><a href="javascript:;" onclick="Show(1)">首页</a></td>
<td><a href="javascript:;" onclick="Show(currentPage-1)">上一页</a></td>
<td><a href="javascript:;" onclick="Show(currentPage+1)">下一页</a></td>
<td><a href="javascript:;" onclick="Show(totalPage)">尾页</a></td>
</tr>
var currentPage = 1;
var totalPage =