标签:
[ValidateInput(false)] 即可, 网上说什么Web.Config 里面改,一点用都没有
[HttpPost] [ActionName("Edit")] [ValidateInput(false)] public ActionResult Edit(BlogInfo model) { model.UpdateTime = DateTime.Now; ef_Help.ModifyWithOutproNames<BlogInfo>(model, "CreateTime"); // db.TagInfo.Where(X=>X.BlogID db.Database.ExecuteSqlCommand(string.Format(@" delete dbo.TagInfo where BlogID={0} delete dbo.Classification where BlogID ={1}", model.BlogID, model.BlogID)); if (model.Tag != null) { foreach (var item in model.Tag.Split(‘,‘)) { db.TagInfo.Add(new TagInfo() { BlogID = model.BlogID, TagName = item }); } } if (model.Classifications != null) { foreach (var item in model.Classifications.Split(‘,‘)) { db.Classification.Add(new Classification() { BlogID = model.BlogID, ClassificationName = item }); } } db.SaveChanges(); return View(model); //return Edit(model.BlogID); // Response.Write("1"); Response.End(); }
.net mvc4 从客户端中检测到有潜在危险的 Request.Form 值
标签:
原文地址:http://www.cnblogs.com/bingguang/p/4547660.html