Pass an argument into the XSL of Content Query Webpart
If create a custom content query webpart you should be able to pass an argument into the XSL via the XslCompiledTransform.Transform() method. This takes in a XslArgumentList which you could populate with the editorpart properties.
http://msdn.microsoft.com/en-us/library/system.xml.xsl.xslcompiledtransform.transform(VS.80).aspx
By the way ToolParts are the old version you should use EditorParts http://www.thesug.org/blogs/lsuslinky/Lists/Posts/Post.aspx?List=ee6ea231%2D5770%2D4c2d%2Da99c%2Dc7c6e5fec1a7&ID=8 and webparts should inherit from System.Web.UI.WebControls.WebParts.WebPart class.
Override ModifyXsltArgumentList and add the custom parameter to the argument list:
protected override void ModifyXsltArgumentList(ArgumentClassWrapper argList)
{
base.ModifyXsltArgumentList(argList);
argList.AddParameter("ParameterName", "", "ParameterValue");
}
Once this method runs the new ParameterName is then available for use within the xslt.
This posting is provided "AS IS" with no warranties, and confers no rights.
浙公网安备 33010602011771号