自己的 DataFormWebPart:无法显示此 Web 部件

发布于 2024-08-27 08:21:39 字数 2229 浏览 9 评论 0原文

无法显示此 Web 部件。要解决该问题,请打开此 Microsoft SharePoint Foundation 兼容的 HTML 编辑器中的网页 例如 Microsoft SharePoint Designer。如果问题仍然存在,请联系 您的 Web 服务器管理员。

webpart 位于 PageLayout 中,插入时不带 webpartzone:

<MyWebParts:MyCustomWebPart runat="server" Description=""
ListDisplayName="" PartOrder="2" HelpLink="" AllowRemove="True"
IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True"
ExportControlledProperties="True" DataSourceID="" Title="" ViewFlag="0"
NoDefaultStyle="TRUE" AllowConnect="True" FrameState="Normal"
PageSize="10" PartImageLarge="" AsyncRefresh="True" ExportMode="All"
Dir="Default" DetailLink="" ShowWithSampleData="False" FrameType="None"
PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False"
AllowEdit="True" ManualRefresh="False" ChromeType="None"
AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True"
ViewContentTypeId="" InitialAsyncDataFetch="False"
MissingAssembly="Cannot import this Web Part." HelpMode="Modeless"
ListUrl="" ID="g_c2180fb9_c667_42f3_aab3_c3340cb0ac5a"
ConnectionID="00000000-0000-0000-0000-000000000000"
AllowZoneChange="True" IsIncludedFilter=""
__MarkupType="vsattributemarkup"
__WebPartId="{C2233FB9-C667-42F3-AAB3-C334223C5A}"
__AllowXSLTEditing="true" WebPart="true" Height="" Width="">
<Xsl>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  <xsl:template match="/">
    <xmp>
      <xsl:copy-of select="*"/>
    </xmp>
  </xsl:template>
</xsl:stylesheet>
 </Xsl>
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="List"
SelectCommand="<View></View>" UpdateCommand=""
InsertCommand="" DeleteCommand="" UseInternalName="True"
ID="spdatasource3">
<SelectParameters>

<asp:Parameter DefaultValue="0"
Name="StartRowIndex"></asp:Parameter><asp:Parameter DefaultValue="0"
Name="nextpagedata">
</asp:Parameter><asp:Parameter DefaultValue="10"
Name="MaximumRows"></asp:Parameter>
</SelectParameters>


</SharePoint:SPDataSource>
</DataSources>
</MyWebParts:MyCustomWebPart> 

Unable to display this Web Part. To troubleshoot the problem, open this
Web page in a Microsoft SharePoint Foundation-compatible HTML editor
such as Microsoft SharePoint Designer. If the problem persists, contact
your Web server administrator.

The webpart is in PageLayout, inserted without webpartzone:

<MyWebParts:MyCustomWebPart runat="server" Description=""
ListDisplayName="" PartOrder="2" HelpLink="" AllowRemove="True"
IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True"
ExportControlledProperties="True" DataSourceID="" Title="" ViewFlag="0"
NoDefaultStyle="TRUE" AllowConnect="True" FrameState="Normal"
PageSize="10" PartImageLarge="" AsyncRefresh="True" ExportMode="All"
Dir="Default" DetailLink="" ShowWithSampleData="False" FrameType="None"
PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False"
AllowEdit="True" ManualRefresh="False" ChromeType="None"
AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True"
ViewContentTypeId="" InitialAsyncDataFetch="False"
MissingAssembly="Cannot import this Web Part." HelpMode="Modeless"
ListUrl="" ID="g_c2180fb9_c667_42f3_aab3_c3340cb0ac5a"
ConnectionID="00000000-0000-0000-0000-000000000000"
AllowZoneChange="True" IsIncludedFilter=""
__MarkupType="vsattributemarkup"
__WebPartId="{C2233FB9-C667-42F3-AAB3-C334223C5A}"
__AllowXSLTEditing="true" WebPart="true" Height="" Width="">
<Xsl>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
  <xsl:template match="/">
    <xmp>
      <xsl:copy-of select="*"/>
    </xmp>
  </xsl:template>
</xsl:stylesheet>
 </Xsl>
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="List"
SelectCommand="<View></View>" UpdateCommand=""
InsertCommand="" DeleteCommand="" UseInternalName="True"
ID="spdatasource3">
<SelectParameters>

<asp:Parameter DefaultValue="0"
Name="StartRowIndex"></asp:Parameter><asp:Parameter DefaultValue="0"
Name="nextpagedata">
</asp:Parameter><asp:Parameter DefaultValue="10"
Name="MaximumRows"></asp:Parameter>
</SelectParameters>


</SharePoint:SPDataSource>
</DataSources>
</MyWebParts:MyCustomWebPart> 

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

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

发布评论

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

评论(3

橘味果▽酱 2024-09-03 08:21:39

我会给你 3 个建议:

  1. 实施错误处理。至少将代码封装在 try/catch 块中。将错误输出到 Web 部件中的文本对象之类的内容。
  2. 将 Visual Studio 调试器附加到 IIS 进程。在构造函数或加载方法中设置断点,然后从那里单步执行代码。
  3. 查看 WSS 日志文件以查看其中是否包含感兴趣的内容。

I will give you 3 suggestions:

  1. Implement error handling. At least by encapsulate you code in a try/catch block. Output the error to something like a Literal object in your web part.
  2. Attach your Visual Studio debugger to the IIS process. Set a breakpoint in your constructor or load method and step through your code from there.
  3. Look in the WSS log files to see if it says something of interest.
生寂 2024-09-03 08:21:39

问题是缺少resourceId,其次我在 xmlDataSource 变量上禁用了缓存,因为它始终显示相同的结果,但查询不同

现在问题是分页 - 在 MyWebParts:MyCustomWebPart 中您看到 PageSize,我将其设置为 1 但我看到 5 个项目我的清单 - 有什么问题吗?我的 XMLDataSource 是否有问题?

此外 - 是否可以将上面写入的内容(MyWebParts:MyCustomWebPart)转换为 .webpart 文件,以便可以在其他 pageLayouts 上重用..?

The problem was missing resourceId and secondly i disabled cache-ing on xmlDataSource variable because it showed always the same results but queries were different

Now problem is paging - in MyWebParts:MyCustomWebPart you see PageSize, I set it to 1 but I see 5 items on my list - whats wrong? Is my XMLDataSource wrong somehow?

Moreover - is it possible to convert what is written above (MyWebParts:MyCustomWebPart) to .webpart file so that it could be reusable on othere pageLayouts .. ?

余生再见 2024-09-03 08:21:39

我注意到您在初始 MyWebParts:MyCustomWebPart 中将 PageSize 设置为 10,并且在 SharePoint:SPDataSource 中您有一个条目

尝试将 SPDataSource 值设置为 1。

Jonathan

I have noticed that you have the PageSize set to 10 in the initial MyWebParts:MyCustomWebPart and in the SharePoint:SPDataSource you have an entry

<asp:Parameter DefaultValue="10" Name="MaximumRows"/>

Try setting the SPDataSource value to 1.

Jonathan

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