在AppCode中的razor调用HtmlHelper方法和UrlHelper方法

原文发布时间为:2011-05-17 —— 来源于本人的百度文章 [由搬家工具导入]

可以写一个帮助类,如下

using System.Web.WebPages;
using System.Web.Mvc;

 public class Helper
 {

public static UrlHelper GetUrlHelper()
 {
            return ((WebViewPage)WebPageContext.Current.Page).Url;
 }

public static HtmlHelper GetHtmlHelper()
{
            return ((WebViewPage)WebPageContext.Current.Page).Html;
}

}

 

http://stackoverflow.com/questions/4710853/using-mvc-htmlhelper-extensions-from-razor-declarative-views

原文地址:https://www.cnblogs.com/handboy/p/7182575.html