我遇到一个问题,当我使用大规模杀伤性武器的编辑它一直希望将其保存为HTML保存textarea的背景。我有以下代码:

在输入元件...

<p>
    <%= this.Html.TextArea("Body", topic.Body, new { @class = "big" })%>
</p>

在脚本做出了放降价......

<script type="text/javascript">

    wmd_options = {
        output: "Markdown"
    };

</script>

在控制器代码...

    [Authorize]
    [ValidateInput(false)]
    [AcceptVerbs(HttpVerbs.Post)]
    public ActionResult Create(FormCollection collection)
    {
        var topic = WikiService.TopicNew();

        topic.Name = collection["Name"];
        topic.Body = collection["Body"];

        // Just saving the contents
    }

我这么想吗?任何想法,为什么它不会返回textarea的降价版本?

有帮助吗?

解决方案

我想通了......我有我的JavaScript在end.is拉在页面的顶部而不是底部...当然,就在说明书说把它。我的坏!

其他提示

不使用这个编辑器自己,但我会努力,在控制器端,以HTML EN /解密。

这,至少,会给你安全的HTML保存到数据库中。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top