asp.net-mvc 中的 FCKEditor
如何在MVC应用程序中添加FCKEditor?
如何在FCKEditor中显示模型中的数据库值?
How to add FCKEditor in MVC application?
How to show database value comes in model, in FCKEditor?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CodeProject 网站并不理想。 它要求你做很多不必要的代码。 您真正需要做的就是包含正确的 javascript 文件:
然后,在页面中,以任意数量的不同方式呈现 FCKEditor。 我更喜欢替换文本区域:
此时,编辑器应该可以正常加载。 您可能需要编辑 fckeditor 配置文件以获得您想要的标准化行为。 然而,此时一切都应该正常。 您的 FCKEditor 实例的行为就像另一个表单字段一样,当您在服务器端从它获取值时,您可以将其视为这样。
创建服务器端 API 供其使用也非常容易。 我创建了一个fckeditor控件,你只需要实现GetFolders、GetFoldersAndFiles和GetFiles即可。 这些只需要几行代码就可以为您提供几乎所有您需要的功能。
我认为使用 MVC 集成/自定义 fckeditor 比在经典 ASP.NET 上更容易。
That CodeProject website isn't ideal. It asks you to do alot of unneccessary code. All you really need to do is include the correct javascript file:
Then, in the page, render the FCKEditor, given any number of different ways. I prefer to replace a text area:
At that point, the editor should load just fine. You will probably need to edit the fckeditor configuration files to get the standardized behavior you want. At this point, however, everything should just work. Your FCKEditor instance will behave just like another form field, and you can treat it as such when you get values from it on the server side.
It's very easy to create the server side api's for it to use as well. I created an fckeditor control, and you just need to implement GetFolders, GetFoldersAndFiles, and GetFiles. Those only take a few lines and give you nearly all the functionality you need.
I think it's easier to integrate / customize fckeditor using MVC than it is on Classic ASP.NET.