码迷,mamicode.com
首页 > Web开发 > 详细

mvc 个别字段无法赋值的问题

时间:2018-06-13 16:33:48      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:IV   ret   sys   view   str   model   UNC   fun   影响   

原因是:字段名为: TYPE   ????  

 

不理解:TYPE 不能赋值是因为关键字?

 

下面的方法里有背景色为红色的那个参数有问题,影响到前台 :

@Html.HiddenFor(model => model.ID)

这句话的赋值,所以传值的时候参数名不能起名为 id。

public ActionResult ClueParameterEdit(string type, string id, string refreshFunction)
        {
            Cust_clue_dict model = null;
            if (!string.IsNullOrEmpty(id))
            {
                Guid guidId = new Guid(id);
                model = new ClueBaseLogic().GetCommomDict(c => c.ID == guidId).First();
            }
            else
            {
                model = new Cust_clue_dict();
                model.DICT_TYPE = type;
                model.ID = System.Guid.NewGuid();
            }
            ViewBag.RefreshFunction = refreshFunction;
            return View(model);
        }

 

mvc 个别字段无法赋值的问题

标签:IV   ret   sys   view   str   model   UNC   fun   影响   

原文地址:https://www.cnblogs.com/wjx-blog/p/9178253.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!