Skip to content

Instantly share code, notes, and snippets.

@PaulStovell
Created January 17, 2011 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PaulStovell/782577 to your computer and use it in GitHub Desktop.
Save PaulStovell/782577 to your computer and use it in GitHub Desktop.
MVC HtmlHelper issues in Razor Helpers
@inherits FunnelWeb.Web.App_Code.HelperPage
@using System.Web.Mvc
@using System.Web.Mvc.Html
@helper Paginator(string actionName, int currentPageNumber, int totalPages)
{
@Html.ActionLink("Index", "Home")
}
public class HelperPage : System.Web.WebPages.HelperPage
{
// Workaround - exposes the MVC HtmlHelper instead of the crappy System.Web.WebPages HtmlHelper
public static new HtmlHelper Html
{
get { return ((System.Web.Mvc.WebViewPage) WebPageContext.Current.Page).Html; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment