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);
        }

猜你喜欢

转载自www.cnblogs.com/wjx-blog/p/9178253.html
MVC