Get current System.Web.UI.Page from HttpContext?

No, from MSDN on HttpContext.Current: “Gets or sets the HttpContext object for the current HTTP request.”

In other words it is an HttpContext object, not a Page.

You can get to the Page object via HttpContext using:

Page page = HttpContext.Current.Handler as Page;

if (page != null)
{
     // Use page instance.
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)