[ValidateInput (false)] can, online say what web. config inside change, a little useless
[HttpPost] [ActionName ("Edit")] [ValidateInput (false)] PublicActionResult Edit (Bloginfo model) {model. UpdateTime=DateTime.Now; Ef_help.modifywithoutpronames<BlogInfo> (model,"Createtime"); //db. Taginfo.where (X=>x.blogidDb. 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(varIteminchModel. Tag.split (',') ) {db. Taginfo.add (NewTaginfo () {BlogID = model. BlogID, TagName =item}); } } if(model. Classifications! =NULL) { foreach(varIteminchModel. Classifications.split (',') ) {db. Classification.add (NewClassification () {BlogID = model. BlogID, Classificationname =item}); }} db. SaveChanges (); returnView (model); //return Edit (model. BlogID); //Response.Write ("1"); Response.End (); }
. NET MVC4 detects potentially dangerous request.form values from the client