将图像添加到 WebParts DeclarativeCatalog

发布于 2024-11-18 05:00:56 字数 650 浏览 5 评论 0原文

我尝试添加图像横幅作为目录项,但它根本不会显示图像。我是否必须将其包装在某些内容中或添加自定义 Web 部件才能实现此功能?

当我在普通的 WebPartZone 中添加完全相同的代码时,它会正确显示图像。

<asp:CatalogZone ID="CatalogZone1" runat="server">
    <ZoneTemplate>
        <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
        <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server" >
            <WebPartsTemplate>
                <asp:Image ID="Image1" ImageUrl="..." runat="server" />
            </WebPartsTemplate>
        </asp:DeclarativeCatalogPart>
    </ZoneTemplate>
</asp:CatalogZone>

I try to add an image banner as a catalog item, but it won't show the image at all. Do I have to wrap it in something or add a custom webpart for this functionality?

When I add the exact same code in an ordinary WebPartZone it shows the image correctly.

<asp:CatalogZone ID="CatalogZone1" runat="server">
    <ZoneTemplate>
        <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
        <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server" >
            <WebPartsTemplate>
                <asp:Image ID="Image1" ImageUrl="..." runat="server" />
            </WebPartsTemplate>
        </asp:DeclarativeCatalogPart>
    </ZoneTemplate>
</asp:CatalogZone>

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文