Ask a Question related to ASP.NET General, Design and Development.
-
tjmii@rocketmail.com #1
User Control Inheritance Problem
I'm trying to use several web user controls on a page that share some common
functionality. So, I want the user controls to inherit from a base class.
I started off making this simple base class
Public Class BaseClass : Inherits System.Web.UI.UserControl
Public Property TableWidth as Integer
Get
Return baseTable.Width
End Get
Set (ByVal Value As Integer)
baseTable.Width = Value
End Set
End Property
Protected WithEvents baseTable As System.Web.UI.WebControls.Table
End Class
I have the code behind for a child class called ChildControl that looks like
this
Public MustInherit Class ChildControl : Inherits BaseClass
' Standard wizard generated code here...
End Class
This code compiles and runs without any problems, but I'm unable to open my
user control in the form designer anymore. I get the following error:
"The file failed to load in the Web Form Designer. Please correct the
following error, then load it again: Property accessor TableWidth on object
ChildControl threw the following exception: 'Object reference not set to an
instance of an object.'"
Is this a known bug with the form designer? Is there any work around so I
can have my control inherit from a base class AND be able to edit it in the
form designer?
Tom
tjmii@rocketmail.com Guest
-
user control problem access value from user control to a page
Thanks a lot for paying attention to my problem , i tell u the problem i have a main form in which i gave a login label that points to a... -
Problem of User Control
Hello, I am newbie of ASP.NET. I tried to develop a simple user control and add it to a web page for testing. However, when I start debug, the web... -
PROBLEM WITH USER CONTROL
Dear all i'm facing a problem in creating a user control that allows me to set inside this user control an instance of a dataset and to set an... -
Problem with web user control
Hi! I have a user control WebUserControl1.ascx with a textbox.I want to change the text of the textbox from another page but i get the error... -
User control problem
Hi all, I have a usercontrol which contains others. How do I get the info from these embedded usercontrols from my parent usercontrol? Regards... -
tjmii@rocketmail.com #2
Re: User Control Inheritance Problem
I did a search on google before posting, but did not find anything that was
useful. I found one post about making the base class abstract, but that did
not make any difference. Could you provide a link, or let me know what
needs to be done to resolve this problem? Thanks.
Tom
tjmii@rocketmail.com Guest



Reply With Quote

