Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc TinyMCE文本编辑器;在post上显示所有html标记,包括<;html>&书信电报;车身>&;诸如此类_Asp.net Mvc_Asp.net Mvc 4_Tinymce 4 - Fatal编程技术网

Asp.net mvc TinyMCE文本编辑器;在post上显示所有html标记,包括<;html>&书信电报;车身>&;诸如此类

Asp.net mvc TinyMCE文本编辑器;在post上显示所有html标记,包括<;html>&书信电报;车身>&;诸如此类,asp.net-mvc,asp.net-mvc-4,tinymce-4,Asp.net Mvc,Asp.net Mvc 4,Tinymce 4,型号: 控制器: public class MyEditor { [Required(ErrorMessage = "Required!")] [AllowHtml] [UIHint("tinymce_classic")] public string PageContents { get; set; } } 视图: public ActionResult TinyE

型号:

控制器:

public class MyEditor
{
    [Required(ErrorMessage = "Required!")]
    [AllowHtml]
    [UIHint("tinymce_classic")]                                        
    public string PageContents { get; set; }         
}
视图:

public ActionResult TinyEditor(MyEditor OBJ)
{
    var obj = OBJ.PageContents;
    if (ModelState.IsValid)
    { 

    }
    return View(OBJ);
}
@使用(Html.BeginForm())
{
@EditorFor(m=>m.PageContents)
@Html.ValidationMessageFor(m=>m.PageContents)
提交
}
问题:在Post上,模型会得到如下所示的所有html标记。为什么会这样 获取html页面的所有标记

:


你好

@using (Html.BeginForm())
{
    <div class="editor-label">
        @Html.EditorFor(m => m.PageContents)                                         
        @Html.ValidationMessageFor(m => m.PageContents)
        <button type="submit">SUBMIT</button>
    </div>        
}
<!DOCTYPE html>
<html> <head> </head> <body> <p>Hello</p> <p><img
src="http://www.my.org/content/img/4.jpg" alt="" width="50"
height="50" /></p> </body> </html>