SharePoint 2010 >> Editing Output HTML >> Issues with page or master page render override

依然范特西╮ 提交于 2019-12-02 03:00:31

The problem is caused by something in the page interfering with the outputcache during render, and more specifically the behaviour of the PostCacheSubstitutionTextHelper class. Probably your call to Render above triggers this.

The welcome.asxc control behaves approximately like this (pseudo sequence diagram):

Page Render > Welcome.ascx Render > PersonalActions Render > PostCacheSubstitutionText.Render > PostCacheSubstitutionTextHelper.RenderAndRegisterSubstitutionCallbackHandler (new instance of)PostCacheSubstitutionText.Render(called in delegate and now writes to HtmlTextWriter) > PostCacheSubstitutionTextHelper. RenderAndRegisterSubstitutionCallbackHandler HttpContext.Response.WriteSubstitution(stuffFromNewInstanceOfPostCacheSubstitutionText)

So enough with the sharepoint freakshow and over to the workaround:-)

Try adding this to your welcome.ascx in the hive:

// in bottom of directives in /CONTROLTEMPLATES/Welcome.ascx
<%@ OutputCache Duration="1" VaryByParam="none" %>

Notice that the Duration is set to 1 since 0 is not allowed for user controls. this leaves a theoretical possiblity for failure, but in our scenario it worked.

I ran into this same problem, I was able to workaround the issue by removing this line from the masterpage.

<wssuc:Welcome id="IdWelcome" runat="server">
</wssuc:Welcome>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!