asp.net mvc 多个 fckeditors 字段

发布于 2024-09-03 00:17:34 字数 1249 浏览 2 评论 0原文

如何在asp.net mvc页面上添加多个fckeditor字段

好这里是代码

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

        <% if (OrganizationMeta.vcr_DateType == "text")     { %>
        <% 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 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 == "text")     { %>
        <% 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

£烟消云散 2024-09-10 00:17:34

我认为错误是你重写了onload。

这是一个快速的解决方案

<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>

希望这能起作用,因为另一个是针对版本 3 的。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文