Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Page is null

Reply
Thread Tools

Page is null

 
 
Johno
Guest
Posts: n/a
 
      08-23-2006
I'm converting a custom webcontrol from ASP.NET 1.1 to 2.0 to take advantage
of 2.0's new features, particularly using the WebResource handler to embed
Javascript includes and GIFs within the assembly instead of placing such
files in an aspnet_client sub-directory. The only problem I've found with the
conversion is that when I call :
this.Page.ClientScript.GetWebResourceUrl()
as a result of calling EnsureChildControls() in property get and set
methods, this.Page is null; I guess this is because the control hasn't been
inserted in the Page's controls collection.
Is there some way to force the control to add itself to the page so that I
can avoid this error?

I guess I could move the calls to this.Page.ClientScript.GetWebResourceUrl()
to the control's prerender method but I'd rather void this if possible.

Are there any good web resources on the differences/enhancements for
creating ASP.NET 2.0 custom web controls? I've looked at Nikhil Kothari's
blog. Any others worth checking out?

Any info/advice gratefully appreciated.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASPX page jscript rt error: null is null or not an object Cirene ASP .Net 1 06-09-2008 07:59 PM
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
difference between null object and null string gokul.b@gmail.com Java 16 10-12-2005 06:43 PM
VB.NET Null to SQL Null (ASP.NET 2.0 GridView) Kivak Wolf ASP .Net 2 06-28-2005 02:01 PM



Advertisments