Using AspCompat in a SharePoint Web Part Page

I am creating a SharePoint web part that needs to use a single threaded COM component. I found that in order to make this work well, I need to add the AspCompat = "true" directive to the page where the web part will live. The problem is that I cannot customize such a page.

I created a new blank web page page through the normal browser interface and then added AspCompat to it using SharePoint Designer. But this causes it to become non-main and the SafeMode parser says the directive is not allowed. Then I changed the blank web part page template to include the directive and created a new page, but got the same error.

I basically need to set up a page on my SharePoint site that is stored on the file system, has this directive, and can contain my web part. How can I create such a page?

+2


source to share


2 answers


According to Microsoft SharePoint developer support, it is simply not possible to use AspCompat on a SharePoint site. The SPPageParserFilter class, which is the one that disallows certain page directives, appears to be involved in the processing of all pages, even those on the file system. See this blog post for details .



+1


source


I recently answered this question with some instructions that include how to create new site page templates that you can use to host web parts. I think it will work for you.



In your case, your aspx page template will have the AspCompat directive built in.

+1


source







All Articles