【发布时间】:2011-09-11 07:53:43
【问题描述】:
我有一个带有以下代码的页面 X.cshtml:
@helper CodeTest{
<h1>Test</h1>
}
而且在我的页面 Y.cshtml 上喜欢使用这个助手...我怎么称呼他?
【问题讨论】:
标签: html razor helpers webmatrix
我有一个带有以下代码的页面 X.cshtml:
@helper CodeTest{
<h1>Test</h1>
}
而且在我的页面 Y.cshtml 上喜欢使用这个助手...我怎么称呼他?
【问题讨论】:
标签: html razor helpers webmatrix
将帮助程序从 X.cshtml 移动到 Z.cshtml,您应该将其放入 App_Code。然后您可以从应用程序中的任何位置调用它。
@Z.CodeTest()
【讨论】: