views:

410

answers:

3

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"&gt;
  <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> 
A: 

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.
Magnus Johansson
Thanks for comment! i did check the code using debugger, public override void DataBind() doesnt produce any error, it must be somewhere inside other dll I I dont know how to check it... I dont have my own contructor, the DataFormWebpart has it and i only overriden DataBidn()
Ok. That should be trapped if you press F5 and let the process contiune. Any unhandled exceptions should now be displayed in the debugger. I have also added a 3rd option to my answer.
Magnus Johansson
A: 

Hi, 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 .. ?

A: 

Hi there,

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

Jonathan Stanton