You are here:   Articles > Asp.net
  |  Login

Programming Articles

Minimize
24

In your code you often have need of getting the current Page. You can HttpContext to get the current Page, like this.

Page page = (Pape)HttpContext.Current.Handler;

The problem with this is the Handler may be something else.

Instead, you should pass the Page into your class or method, like this.

public static void Method(Page page)

By Andrew Weitzen, Bronze Inc. (c) 2010

Bronze is the publisher of several online Internet journals including: InternetHandholding.com, DomainNames.gs, DotNetNuke.bz, Programmer.bz, Software.vg, WebHosting.vg

Posted in: Asp.net

Post Rating

Comments

There are currently no comments, be the first to post one.

Post Comment

Only registered users may post comments.

Programmer Newsletter

Minimize

Subscribe to the Internet Handholding newsletter



Reccomend Programmer.bz

Minimize

Share/Bookmark Bookmark and Share