Created
January 17, 2011 07:09
-
-
Save PaulStovell/782577 to your computer and use it in GitHub Desktop.
MVC HtmlHelper issues in Razor Helpers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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