开发者

asp.net mvc multiple fckeditors field

how to add multiple fckeditor field on asp.net mvc page

ok here is the code

   <% foreach (var OrganizationMeta in ((IEnumerable<Egovt.Models.OrganizationMeta>)ViewData["OrganizationMeta"])) { %>

        <% if (OrganizationMeta.vcr_DateType == "t开发者_运维知识库ext")     { %>
        <% TempData["OrganizationMeta"] = OrganizationMeta.vcr_MetaKey + Lang.int_LangId; %>
        <% Html.RenderPartial("ControlRender"); %>
        <% } %>
        <% } %>
    </div>

controlrender

<script src="<%= Url.Content("~/Content/js/fck/fckeditor.js") %>" type="text/javascript"></script>
            <script type="text/javascript">

                window.onload = function()
                {
                    var sBasePath = '<%= Url.Content("~/Content/js/fck/") %>';
                    var oFCKeditor = new FCKeditor('<%=TempData["OrganizationMeta"] %>');
                    oFCKeditor.BasePath = sBasePath;
                    oFCKeditor.ReplaceTextarea();
                }
            </script>
         <%= Html.TextArea(TempData["OrganizationMeta"].ToString(),"", new { @name = TempData["OrganizationMeta"] })%>

How will i implement it


I think that the error is that you over write the onload.

this is a fast solution

<script src="<%= Url.Content("~/Content/js/fck/fckeditor.js") %>" type="text/javascript"></script>
<%= Html.TextArea(TempData["OrganizationMeta"].ToString(),"", new { @name = TempData["OrganizationMeta"] })%>
<script type="text/javascript">
{
  var sBasePath = '<%= Url.Content("~/Content/js/fck/") %>';
  var oFCKeditor<%=TempData["OrganizationMeta"] %> = new FCKeditor('<%=TempData["OrganizationMeta"] %>');
  oFCKeditor<%=TempData["OrganizationMeta"] %>.BasePath = sBasePath;
  oFCKeditor<%=TempData["OrganizationMeta"] %>.ReplaceTextarea();
}
</script>

Hope this works, because the other is for the version 3.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜