I'm trying to use DotNetOpenAuth with Razor/MVC3. Most of DotNetOpenAuth HTML helpers are accepting System.Web.UI.Page as one of parameters, which works fine standard using WebForms engine but does not with Razor. Is it possible to cast dynamic WebPageBase.Page into System.Web.UI.Page somehow?
Thanks, Antonin
System.Web.UI.Page is part of the Web Forms page model and is totally unrelated to Razor. A Razor page inherits from System.Web.WebPages.WebPage which isn't part of the same hierarchy. As GvS mentioned, the "Page" property is a different object in Razor. In Razor, that property is just a C# dynamic object that provides a shortcut for accessing PageData values. For example: PageData["foo"] is the same as Page.foo.
They are totally different objects. So, no, you cannot cast or convert into a System.Web.UI.Page.
But this article might help you further.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With