RPM*_*984 4 asp.net-mvc html-helper viewpage razor asp.net-mvc-3
我有一个ASP.NET MVC 3 Razor Web应用程序.
我有一个WebViewPage扩展名:
public static bool Blah(this WebViewPage webViewPage)
{
return blah && blah;
}
Run Code Online (Sandbox Code Playgroud)
我想从我的HtmlHelper扩展程序访问这个:
public static MvcHtmlString BlahHelper(this HtmlHelper htmlHelper, string linkText, string actionName)
{
// how can i get access to the WebViewPage extension method here?
}
Run Code Online (Sandbox Code Playgroud)
WebViewPage如果必须的话,我当然可以复制扩展的功能,但只是想知道是否可以从HTML帮助程序访问它.
// Warning: this cast will crash
// if you are not using the Razor view engine
var wvp = (WebViewPage)htmlHelper.ViewDataContainer;
var result = wvp.Blah();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2586 次 |
| 最近记录: |