asp.net-mvc - 带有 Ckeditor 的 MVC2 应用程序“具有潜在危险的 Requ

当我使用我的 FCK 编辑器时,我收到“从客户端检测到潜在危险的 Request.Form 请求值”异常。

如何在提交表单之前进行编码,或者在不禁用数据注释验证的情况下禁用此验证?

这是我的 View 代码:

 <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary("Please complete in a right way the fields below.") %>

        <fieldset>
            <legend>Fields</legend>
            <div class="editor-field">
                <%: Html.LabelFor(e => e.Name)%>
                <%: Html.TextBoxFor(e => e.Name)%>
                <%: Html.ValidationMessageFor(e => e.Name)%>
            </div>
            <div class="editor-field">
                <%: Html.LabelFor(e => e.Teaser) %>
                <%: Html.TextAreaFor(e => e.Teaser)%>
                <%: Html.ValidationMessageFor(e => e.Teaser)%>
            </div>
            <div class="editor-field">
                <%: Html.LabelFor(e => e.Description) %>
                <%: Html.TextAreaFor(e => e.Description)%>
                <%: Html.ValidationMessageFor(e => e.Description)%>
            </div>
            <p>
                <input type="submit" />
            </p>
        </fieldset>

    <% } %>

<script type="text/javascript">
   //<![CDATA[
   // This call can be placed at any point after the
   // <textarea>, or inside a <head><script> in a
   // window.onload event handler.
   // Replace the <textarea id="xxxxxx"> with an CKEditor
   // instance, using default configurations.
   CKEDITOR.replace("Description");
   //]]>
</script>

非常感谢。

最佳答案

<httpRuntime requestValidationMode="2.0" />

检查:Request Validation - ASP.NET MVC 2

关于asp.net-mvc - 带有 Ckeditor 的 MVC2 应用程序“具有潜在危险的 Request.Form,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3475896/

相关文章:

azure - 使用 Azure SQL 的 ASP.Net Core 2.1 Serilog SQ

extjs - 商店的监听器功能在网格更新时触发两次

perl - Perl 中的并行计算

selenium-webdriver - 在 Heroku 上使用 webdrivers selen

visual-studio-code - 如何在 visual studio 代码中显示完整的长行(

visual-studio-2015 - IApplicationBuilder 不包含 UseWe

macos - undefined symbol : "boost::system::generic

forms - 如何使用 cakephp 和 twitter bootstrap 在 poSTLin

scala - 如何使用 Scala 在 lagom 中为 NoHostAvailableExcep

extjs - 在绑定(bind) View 中应用条件