【问题标题】:Using ViewComponents in RTE在 RTE 中使用 ViewComponents
【发布时间】:2019-02-04 09:03:17
【问题描述】:

我正在尝试在 CKEditor 中使用 ViewComponents 标签助手来显示一些产品,但它没有。

我创建了一个这样的 vc 标签助手:

<vc:products html-class="col-12 col-md-5" html-style="" skip="0" take="10"></vc:products>

现在我正在尝试在 CKEditor 中使用此代码,我的意思是帖子编辑器可以在他们想要的任何地方调用产品。但它不起作用。 CKEditor 将其显示为 html 代码。

我该怎么办?

【问题讨论】:

    标签: asp.net-core asp.net-core-2.2 asp.net-core-viewcomponent


    【解决方案1】:

    此代码将在服务器端实际执行,它会将部分 html 添加到您的页面,然后服务器会将其返回给客户端。

    &lt;vc:products html-class="col-12 col-md-5" html-style="" skip="0" take="10"&gt;&lt;/vc:products&gt;

    在这里,我不确定您要完成什么,但您不能在客户端动态使用标签助手。可能这个链接可以帮助你。

    Dynamically Produce Razor Views at Runtime?

    【讨论】:

      猜你喜欢
      • 2015-02-06
      • 2020-08-19
      • 1970-01-01
      • 1970-01-01
      • 2022-12-21
      • 1970-01-01
      • 1970-01-01
      • 2022-12-01
      • 2019-08-03
      相关资源
      最近更新 更多