ViewBag用来做视图的值绑定,我不清楚是不是这么称呼.之前看过安卓的值绑定做法,mvc直接动态类型,瞬间逼格满满 Controller: public class HomeController : Controller { public ActionResult Index() { ViewBag.TryIt = "Hellow ViewBag"; ViewBag.Message = "Modify this template to jump-start your ASP…
1.视图获取json类型数据 var str = '@(ViewBag.loginInfoList)'; if ($.trim(str).length>0) { re = new RegExp(""", "g"); //定义正则表达式,g标识全部替换 将\转译为",成为正确的json格式数据 var newstr = str.replace(re, '"'); re = new RegExp("{", &quo…