09 2021 档案

摘要:ExpandoObject作为ViewModel给view传值 Action public ActionResult Index(string id) { dynamic d = new ExpandoObject(); d.id = id; d.name = "张三"; return View(d 阅读全文
posted @ 2021-09-27 13:57 WebApi 阅读(387) 评论(0) 推荐(0) 编辑
摘要:1.在controller里获取路由参数: var controller = RouteData.Values["controller"];//action,id或其他路由参数同理 这种方式很常用,还有一种方式就是,直接在action上定义参数,通过模型绑定的方式获取: public ActionR 阅读全文
posted @ 2021-09-23 13:35 WebApi 阅读(276) 评论(0) 推荐(0) 编辑
摘要://代码不全,随意记录笔记 public ActionResult GetListJson(int page, int limit,string title,int passed=-1, int good =-1,int classID=-1,string t1="",string t2="") { 阅读全文
posted @ 2021-09-14 14:46 WebApi 阅读(953) 评论(0) 推荐(0) 编辑

CopyRight © 博客园 WebAPI
点击右上角即可分享
微信分享提示