public IActionResult AddMarkdownToPage(MarkdownViewModel model) { //if (model.MarkdownData?.Contains("<script>")==true) //{ // ModelState.AddModelError("","Unsafe tag <script>...</script>"); //} if (ModelState.IsValid) { var page = Documentation.Pages.FirstOrDefault(x => x.DocPageID == model.PageID); page.Data = model.MarkdownData; page.Name = model.PageName; Documentation.UpdatePage(page); return(LocalRedirect(model.returnUrl)); } return(View(model)); }