Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi, this is my first post in this forum. And I hope you help me.

I am trying to make a subclass from my custom web control. But wherever the definition of the subclass occures, it fires parent's Page_Load without initializing components, and that causes the parent to throw a NullReferenceException, because all controls are not initialized. ny one have ideas on solving this problem?

Posted

Well if you are using C# did you:

 

public class subclass : rootclass
{
     public subclass() : base()
     {

     }
}

 

Or in VB:

Public Class subclass Inherits rootClass
    Public Sub New()
         MyBase.New()
    End Sub
End Class

 

And in your constructor of your base (root) class is the constructor calling the initalize procedure? Is there anything in your derived (sub) class that needs to be initialized in the constructor call?

 

You have a very open question that I've answered the best I can with the little bit of information that is there. If you want a better answer posts the classes in their entirety (in a zip file).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...