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

原因是:字段名为: 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);
        }

 

posted @ 2018-06-13 15:58  星星c#  阅读(232)  评论(0编辑  收藏  举报