In ASP.NET web forms, I would access the page class by doing the following:
(Page)HttpContext.Current.Handler
Since the page was the HTTP handler for ASPX requests, this worked great. This isn’t an option for a razor web page (NOT talking MVC here, but the razor web pages web site), which I cannot access the System.Web.WebPages.WebPage class or can figure out a way to do so. Any ideas how I can do this?
Thanks.
Are you looking for
WebPageContext.Current.Page?