Sharepoint 2010 resolves the issue of the dfwp-unable to display this Web part

Source: Internet
Author: User

"Unable to display" the Web part. To troubleshoot the problem, open this Web page in a Microsoft SharePoint foundation-compatible HTML editor such as Micros Oft SharePoint Designer. If the problem persists, contact your WEB server administrator. "

Typically this happens on top of a custom form with many fields, such as more than 30 segments.

This is usually the first visit when this error, the page is refreshed after the normal display, it is estimated that because of the cache, if not continuous access, some time after the error, it is estimated that the cache is invalid.

Microsoft has given the solution in this KB:
1. To simplify the code of XLS, so as to speed up parsing speed, so do not timeout normal display (XSL is not very good to write AH)
2. Use InfoPath form instead of the default Web Form (as if you need SharePoint Enterprise Edition)
3. Inherit the DataFormWebPart from the system and create and apply its own webpart (seemingly complex but most feasible)
1 Sub class The DataForm Web part. Override the following methods. Then Deploy the assembly.

The code is as follows Copy Code

Example:
public class Customdfwp:dataformwebpart
{
public override bool Isghosted
{
Get
{
return true;
}
}
public override bool Canhaveservercontrols
{
Get
{
return true;
}
}
}

2) Add a safe control entry to the Web.config
Example: <safecontrol assembly= "customdfwp, version=1.0.0.0, culture=neutral, publickeytoken=963f869a440db619" Namespace= "CUSTOMDFWP" typename= "*" safe= "true" allowremotedesigner= "true" safeagainstscript= "False"/>

3) Add The following to the <tagMapping> element of the web.config
Example: <add tagtype= "Microsoft.SharePoint.WebPartPages.DataFormWebPart, Microsoft.SharePoint, version= 14.0.0.0, Culture=neutral, publickeytoken=71e9bce111e9429c "mappedtagtype=" customdfwp.customdfwp, CustomDFWP, version=1.0.0.0, culture=neutral, publickeytoken=963f869a440db619 "/>

4) Register the assembly on the form page.
Example: <%@ Register tagprefix= "customdfwp namespace=" customdfwp "assembly=" customdfwp, version=1.0.0.0, Culture =neutral, publickeytoken=963f869a440db619 "%>

5 on the form page find <webpartpages:dataformwebpart > replace it with the new custom tag.
Example:<customdfwp:customdfwp>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.