Inside the xslt rendering, I call the following
<xsl:value-of select="di:inject()"/>
The appropriate class retrieves the current page object and tries to change the page title.
public class XslHelper : Sitecore.Xml.Xsl.XslHelper
{
public void inject()
{
Page page = HttpContext.Current.Handler as Page;
page.Header.Controls.Add(new HtmlLink { Href = "/style.css" });
}
}
However, the title is not updated? Why is this another way to achieve the same result?
EDIT: We ended up extending the XslRender template and storing dependencies there, which can then be assembled and added to the session by overriding the InsertRenderings class in the renderLayout pipeline. Then the session object can be accessed in Page_Load in a layout that can access the page title.
source
share