所以我希望能够在剃须刀页面中执行以下操作:
<div> some markup
@using(var myMarkupCapturer = Html.CaptureHtml())
{
<div>this markup will be captured</div>
}
</div>
有什么建议么?我正在考虑用我的 ViewContext ( ViewContext.Writer
) 的 TextWriter 替换一个可以被拦截的专用版本。有没有更好的办法?