问题描述
// Controller.cs //
public ActionResult Create()
{
历史他的=新历史();
his.CaseID =" 10000" + db.History.OrderByDescending(x => x.CaseID).ToList< History>();
ViewBag.caseid = his.CaseID;
返回查看();
}
//观看模型//
{
@ ViewBag.caseid
}
我要查看
CaseID |姓名|数字
10000 | ------- | --------
10001 | ------- | ----- ---
10002 | ------- | --------
10003 | ------- | --- -----
请谢谢
//Controller.cs//
public ActionResult Create()
{
History his = new History();
his.CaseID = "10000" + db.History.OrderByDescending(x => x.CaseID).ToList<History>();
ViewBag.caseid = his.CaseID;
return View();
}
//Views model//
{
@ViewBag.caseid
}
I want view
CaseID|Name|Number
10000 |-------|--------
10001 |-------|--------
10002 |-------|--------
10003 |-------|--------
Please Thank you
这篇关于如何从sql运行自动编号到文本框MVC 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!