T
Travis Bolton
I have a problem that seems like it should be simple (or not really a
problem in the first place), that has become quite frustrating.
I have a page that has several user controls on it. I am retrieving an
object on the Web Form that each User Control will need. So instead of
manually creating the exact same public property in each user control, I
want to create a base user control that inherits from
System.Web.UI.UserControl which will handle the commong properties and then
derive each of my User Controls from that base class.
I have:
Public Class UserControlBase
Inherits System.Web.UI.UserContrl
Protected mSomeVal
Public Property SomeVal() as SomeType
Get
return mSomeVal
End Get
Set (Value as SomeType)
mSomeVal = Value
End Set
End Property
End Class
Public Class MyUserControl
Inherits UserControlBase
'All the stuff to show the page, including Page_Load, etc.
End Class
When I try to view the .ascx file in Visual Studio to design the actual user
control, I get an error message that says:
"The file could not be loaded into the Web Forms designer. Please correct
the following error and the try loading it again:
Type Abstract
Make sure all of the classes used in the page are built or referenced in the
project. Click Help for more informatin"
The Help button on the error is, of course, no help
Any help would be greatly appreciated. I've already blown several hours
trying to figure this out. I know I could do it with an interface, but then
I'd still have to code the properties in each user control so that wouldn't
get me too much.
Thanks,
Travis
problem in the first place), that has become quite frustrating.
I have a page that has several user controls on it. I am retrieving an
object on the Web Form that each User Control will need. So instead of
manually creating the exact same public property in each user control, I
want to create a base user control that inherits from
System.Web.UI.UserControl which will handle the commong properties and then
derive each of my User Controls from that base class.
I have:
Public Class UserControlBase
Inherits System.Web.UI.UserContrl
Protected mSomeVal
Public Property SomeVal() as SomeType
Get
return mSomeVal
End Get
Set (Value as SomeType)
mSomeVal = Value
End Set
End Property
End Class
Public Class MyUserControl
Inherits UserControlBase
'All the stuff to show the page, including Page_Load, etc.
End Class
When I try to view the .ascx file in Visual Studio to design the actual user
control, I get an error message that says:
"The file could not be loaded into the Web Forms designer. Please correct
the following error and the try loading it again:
Type Abstract
Make sure all of the classes used in the page are built or referenced in the
project. Click Help for more informatin"
The Help button on the error is, of course, no help
Any help would be greatly appreciated. I've already blown several hours
trying to figure this out. I know I could do it with an interface, but then
I'd still have to code the properties in each user control so that wouldn't
get me too much.
Thanks,
Travis