我有一个这样的辅助方法:
@helper Message(Func<object, object> markup) {
<tr class="message">
<td width="100%" style="padding-bottom: 1em; color: #333333; font-size: 14px; line-height: 1.3">
@markup.DynamicInvoke(this.ViewContext)
</td>
</tr>
}
我用剃刀标记调用,例如:
@<text>
We are writing to let you know that @ViewBag.HostName has canceled @ViewBag.TripName and we've removed the trip from your My Trips page.
<br />
<br />
To plan a new trip, go back to Travefy
<br />
</text>
但是,我不知道获取页面的语法ViewContext
,因为在我看到的示例中this.ViewContext
,this
助手中不存在。我可以在哪里访问它的任何想法?