Yasser Posted January 19, 2006 Posted January 19, 2006 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? Quote
bri189a Posted January 20, 2006 Posted January 20, 2006 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). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.