Bị lỗi không nhập được các thẻ html, javascript vào textbox, eiditer,... trong asp.net MVC4, MVC5,..6 lưu xuống cơ sở dữ liệu. Mã: Server Error in '/' Application. A potentially dangerous Request.Form value was detected from the client (Name="<h1>son</h1>"). Description: ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see go.microsoft.com/fwlink/?LinkID=212874. Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (Name="<h1>son</h1>"). Để sửa lỗi này bạn thêm đoạn code sau vào Controllers chứa ActionResult cần xử lý: Mã: [ValidateInput(false)] Ví Dụ: Mã: [ValidateInput(false)]//cho phép nhậm dữ liệu html, thẻ vào nút input public ActionResult Validate(Studen model) { if(ModelState.IsValid) { ModelState.AddModelError("","Chúc mừng bạn đã nhập đúng"); } return View("Index"); }