2010-04-02 24 views
1

無法顯示此Web部件。要解決此問題,請在Microsoft SharePoint Foundation兼容的HTML編輯器 (如Microsoft SharePoint Designer)中打開此 網頁。如果問題仍然存在,請聯繫您的Web服務器管理員 。Own DataFormWebPart:無法顯示此Web部件

之WebPart是在頁面佈局,插入無的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>

回答

0

我會給你3點建議:

  1. 實施錯誤處理。至少通過將代碼封裝在try/catch塊中。將錯誤輸出到Web部件中的文字對象之類的東西。
  2. 將您的Visual Studio調試器附加到IIS進程。在你的構造函數或加載方法中設置一個斷點,並從那裏開始執行代碼。
  3. 查看WSS日誌文件以查看它是否表示感興趣。
+0

感謝您的評論!我沒有檢查代碼使用調試器,公共覆蓋無效的DataBind()不會產生任何錯誤,它必須在其他DLL內的某處II不知道如何檢查它...我沒有我自己的構造函數,DataFormWebpart有它,我只覆蓋DataBidn() – user307852 2010-04-03 08:10:51

+0

好的。如果按F5並讓過程保持不變,應該會被困住。現在應該在調試器中顯示任何未處理的異常。我還爲我的答案添加了第三個選項。 – 2010-04-03 08:39:41

0

的問題是缺少RESOURCEID其次我禁用緩存-ING上的XmlDataSource變量,因爲它總是顯示了同樣的結果,但查詢是不同的

現在的問題是分頁 - 在MyWebParts:MyCustomWebPart你看到每頁,我將其設置爲1,但我在列表中看到5個項目 - 什麼錯了?某種程度上我的XMLDataSource錯了嗎?

此外 - 是否有可能將上面寫的(MyWebParts:MyCustomWebPart)轉換爲.webpart文件,以便它可以在其他pageLayouts上重用..?

0

我注意到,你有每頁在初始MyWebParts設置爲10:MyCustomWebPart和中的SharePoint:SPDataSource你有一個入口

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

嘗試SPDataSource值設置爲1

喬納森

相關問題