我想使用AjaxControlToolkit HtmlEditorExtender。我有AjaxControlToolkit.dll以及所有内容,但是当我在localhost上运行应用程序时,抛出了异常
Fatal error: Uncaught RuntimeException: Unable to load application.
- Type `composer install` if you are developing locally.
- Type `vagrant ssh -c 'composer install'` if you are using Vagrant.
- Type `docker-compose run zf composer install` if you are using Docker. in C:\xampp\htdocs\abc\public\index.php:25
Stack trace: #0 {main} thrown in C:\xampp\htdocs\abc\public\index.php on line 25
当我不打破异常时,我得到了一个错误
`Exception thrown: 'System.IndexOutOfRangeException' in Web.dll
Exception thrown: 'System.IO.FileLoadException' in AjaxControlToolkit.dll
Exception thrown: 'System.Web.HttpUnhandledException' in System.Web.dll
Exception thrown: 'System.Web.HttpUnhandledException' in System.Web.dll
Exception thrown: 'System.IndexOutOfRangeException' in Web.dll`
这是我的代码:
AjaxControlToolkit.pdb not loaded
临时解决方案:
我在
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="false" > </ajaxToolkit:ToolkitScriptManager> <br /> <br /> <asp:TextBox ID="TextEditor" runat="server" Height="191px" OnTextChanged="TextEditor_TextChanged" Width="746px" Text="Hello <b>world!</b>"></asp:TextBox> <br /> <br /> <ajaxToolkit:HtmlEditorExtender ID="HtmlEditorExtender1" runat="server" TargetControlID="TextEditor" DisplaySourceTab="True"> <Toolbar> <ajaxToolkit:Undo /> <ajaxToolkit:Redo /> <ajaxToolkit:Bold /> <ajaxToolkit:Italic /> <ajaxToolkit:Underline /> <ajaxToolkit:StrikeThrough /> <ajaxToolkit:Subscript /> <ajaxToolkit:Superscript /> <ajaxToolkit:JustifyLeft /> <ajaxToolkit:JustifyCenter /> <ajaxToolkit:JustifyRight /> <ajaxToolkit:JustifyFull /> <ajaxToolkit:InsertOrderedList /> <ajaxToolkit:InsertUnorderedList /> <ajaxToolkit:RemoveFormat /> <ajaxToolkit:SelectAll /> <ajaxToolkit:UnSelect /> <ajaxToolkit:Delete /> <ajaxToolkit:Cut /> <ajaxToolkit:Copy /> <ajaxToolkit:Paste /> <ajaxToolkit:BackgroundColorSelector /> <ajaxToolkit:ForeColorSelector /> <ajaxToolkit:FontNameSelector /> <ajaxToolkit:FontSizeSelector /> <ajaxToolkit:Indent /> <ajaxToolkit:Outdent /> <ajaxToolkit:InsertHorizontalRule /> <ajaxToolkit:HorizontalSeparator /> <ajaxToolkit:InsertImage /> </Toolbar> </ajaxToolkit:HtmlEditorExtender>
->中添加了一个attrajaxToolkit:HtmlEditorExtender
,然后一切正常。但是我认为 导致安全问题。
答案 0 :(得分:0)
确保正确安装了AjaxControlToolkit
。我建议您通过Nuget
安装该库。还要检查是否包含AjaxControlToolkit.dll
。也许您还需要HtmlAgilityPack
和SanitizerProviders
库/ dll。
请确保以下块位于system.web
文件的web.config
配置部分中:
<pages>
<controls>
<add tagPrefix="ajayToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
</controls>
</pages>
如果指定了此密码,则可以在页面上添加AjaxControlToolkit
。