Devexpress mvc html编辑器拼写检查不起作用

时间:2013-07-03 05:57:18

标签: asp.net-mvc devexpress

我有使用DevExpress ASP.NET MVC HTMLEditor的MVC项目。编辑器处于局部视图中,在回调时呈现。这是拼写检查初始化设置:

@Html.DevExpress().HtmlEditor(
settings =>
{
    settings.SettingsSpellChecker.Culture = new System.Globalization.CultureInfo("en-us");
    ASPxSpellCheckerISpellDictionary dictionary = new ASPxSpellCheckerISpellDictionary();
    dictionary.AlphabetPath = "~/Content/Dictionaries/EnglishAlphabet.txt";
    dictionary.GrammarPath = "~/Content/Dictionaries/english.aff";
    dictionary.DictionaryPath = "~/Content/Dictionaries/american.xlg";
    dictionary.CacheKey = "ispellDic";
    dictionary.Culture = new System.Globalization.CultureInfo("en-us");
    dictionary.EncodingName = "Western European (Windows)";
    settings.SettingsSpellChecker.Dictionaries.Add(dictionary);

    ...

    settings.Toolbars.Add(toolbar =>
        {
            toolbar.Items.Add(new ToolbarCheckSpellingButton(true));

            ...

        }
}).GetHtml()

但是当我按下“检查拼写”按钮时,按钮编辑器不执行任何操作(只是发送回调以重新呈现部分视图)并且js控制台中没有错误。

是否有其他选项可以启用拼写检查,我忘了查看?

1 个答案:

答案 0 :(得分:0)

<script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>

尝试后将这些添加到您的布局中。