开发者

In-site text editors - what are my options aside from TinyMCE for a MVC 2 site?

I'm curious about what my options are for in-site text editors. I'm also wondering if some play with MVC 2 better than oth开发者_JS百科ers.


I looked at a bunch of them recently and decided on ckeditor for my mvc site.

http://ckeditor.com/

It was a snap to integrate and has been flawless so far.

    <script type="text/javascript" src="<%= Url.Content("~/content/js/ckeditor/ckeditor.js") %>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/content/js/ckeditor/jquery.js") %>"></script>

    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $('#HomeIndexMessage').ckeditor({ toolbar: 'MyToolbar', 
                                                height : '350px'
                                            } );
        });
    </script>



   <% using (Html.BeginForm("EditHomeMessage", "AdminSiteSettings", FormMethod.Post, new { name = "editForm" }))
   {%> 
        <%: Html.HiddenFor(x => x.RowId) %>

        <fieldset>
            <legend>Home Page Text</legend>
                <ol>
                    <li>
                        <table>
                            <tr>
                                <td>
                                    <textArea id="HomeIndexMessage" name="HomeIndexMessage"><%=Model.HomeIndexMessage%></textArea>
                                </td>
                            </tr>
                        </table>
                    </li>
                </ol>
        </fieldset>

        <div class="submitform">   
            <%: Html.Button("EditHomeMessage", "Save", HtmlButtonType.Submit)%>
            <%= Html.ActionLink<ClientPortalHomeController>("Cancel", x => x.Index())%>
        </div>

    <%}%>


There's also WMD and its C# port markdownsharp.


No particular editor is going to work better with MVC or not because all the editors are based on the client and the server doesn't really care about that, so it's just down to your own preference.

The only major one I see missing is the Yahoo YUI Rich Text Editor. I use it in an MVC site of mine and it works really well. I decided to use it because it has a nice clean look and feel to it and still easily customize and powerful.

You could check out the wikipedia article for online rich-text editors for a list of the more popular ones.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜