我在包含图表的 Web 部件内放置了一个面板。Web 部件区域的标题为 Untitled[0]、Untitled[1]....面板控件或 Web 部件中没有标题标记。任何人都知道如何解决这个问题。

有帮助吗?

解决方案

尝试用这个:

            <asp:WebPartZone Height="100px" Width="75%" runat="server" 
                ID="productSummaryZone" HeaderText="Product summary">
                <ZoneTemplate>
                    <uc:ProductSummary title="Product summary title" runat="server" ID="productSummary" />
                </ZoneTemplate>
            </asp:WebPartZone>
  • HeaderText="Product summary". 。当您处于编辑、设计模式或连接模式时,此标题用于识别您的 Web 部件(这不是标题)

  • <uc:ProductSummary title="Product summary title" runat="server" ID="productSummary" />. 。这代表了一个 UserControl 在这种情况下,这被添加到 ZoneTemplate, ,如您所见,您可以通过 title="..." 给你的 UserControl 即使您没有以该名称申报财产, WebPart 然后使用该属性来显示标题...有点棘手

输出

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top