我希望将我的 asp.net 网页中的字符串值传递给 t4 运行时模板。运行时模板包含更多模板文件。IE。
我的运行时模板是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?