利用反射获取Model值
public ActionResult Base(UserModel Model) { Model.Tel = string.Format("{0}-{1}", Model.Areacode, Model.Tel); Model.Fax = string.Format("{0}-{1}", Model.Areacode, Model.Fax); Model.UserTypeID = Convert.ToInt16(ControllerContext.RouteData.Values["id"]); foreach (System.Reflection.PropertyInfo info in typeof(UserModel).GetProperties()) { try { log.Info((info.Name + " " + info.GetValue(Model, null).ToString())); } catch(Exception e) { log.Error(string.Format("错误字段:{0}", info.Name), e); } } return View(); }