留有资料,以后学习
1.后台


public ActionResult Index() { //用户id string caid = "40";// Request["userid"]; if (!(string.IsNullOrEmpty(caid))) { //获取用户实体 BLL.c_addressbook bll_addressbook = new BLL.c_addressbook(); var addressbook = bll_addressbook.GetModel(int.Parse(caid)); //将实体赋值给Model ViewData.Model = addressbook; } return View(); }
2.前台


//添加引用
@model PM.Model.c_addressbook
//使用方法
@Model.实体对象名称