Wednesday, March 10, 2010

Asp.net Accessing Page Object from Controls During Initialization

When controls are initialized on an asp.net page, the Page object may not be available. You get an error message that says: Object
reference not set.

After initialization, during the Load phase, the Page object is available.

What if you need the Page object during the initialization phase, such as in the CreateChildControls method?

See here for the solution.

www.programmer.bz/Articles/tabid/159/asp_net_sql/156/Aspnet-Accessing-Page-Object-from-Controls-During-Initialization.aspx

No comments:

Post a Comment