I am trying to include an Image control within my web part. In EnsureChildControls I have the following code:
Image image = new Image(); image.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(this.GetType(), "hotline.jpg");
I get a NullPointer exception and this is because 'Page' is null.
Why might this be? Am I doing this all wrong anyway?