【发布时间】:2011-01-04 03:19:57
【问题描述】:
我正在 c# sharepoint webpart 代码中加载一个 XSLT 文件,如下所示:
string path = context.Request.MapPath("/_layouts/RSSWeatherXSL.xsl");
XslTransform trans = new XslTransform();
trans.Load(path); // loading xsl file
XSLT 文件相当大,大约 134 行。
我需要在 XSLT 中引用由代码隐藏生成的路径的图像。
SPWeb currentWeb = SPControl.GetContextWeb(Context);
2.Type currentType = this.GetType();
3.string classResourcePath = SPWebPartManager.GetClassResourcePath(currentWeb, currentType);
我怎么能这样做? 谢谢,
【问题讨论】:
-
如果您不使用 .NET 1.0 或 1.1,您应该使用 XslCompiledTransform msdn.microsoft.com/en-us/library/… 而不是 XslTransform。
标签: sharepoint xslt resources web-parts