【发布时间】:2013-05-31 05:50:28
【问题描述】:
我希望将我的 asp.net 网页中的字符串值传递给 t4 运行时模板。运行时模板包含更多模板文件。即。
我的运行时模板是 runTym.tt
这个 runTym.tt 包含两个 t4 模板,即:t1.tt 和 t2.tt
runTym.tt 代码是这样的:
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ include file="t1.tt" #>
<#@ include file="t2.tt" #>
我想将一个值传递给 t1.tt 文件。但是,我正在从 asp.net 网页访问 runTym.tt 文件。
runTym runT = new runTym();
string val= runT.TransformText();
有没有办法通过runTym.tt将参数值传递给t1.tt?
【问题讨论】: