D
darrel
Continuing my ongoing journey through base classes...
Thanks to help from some folks, I think I've gotten my syntax close (but not
quite) where it needs to be.
What I am doing: trying to load a variety of usercontrols programtically and
then assigning property values to them.
What I have:
I created a baseclass for these controls that will be loaded:
-------------------------
Public Class BaseLoadedControl
Inherits System.Web.UI.UserControl
public siteID as String
End Class
-------------------------
Then, in my usercontrol that I am using to then load one of these controls,
I have this:
-------------------------
dim customContentControl as BaseLoadedControl
customContentControl = CType(Page.LoadControl(thecontrol),
BaseLoadedControl)
'theControl = the string of the specific control I am loading...such as
sample.ascx
-------------------------
The problem is that gives me an 'invalid cast' error.
So, once again, I'm stuck. Anyone see where my logic and/or syntax may be
off?
-Darrel
Thanks to help from some folks, I think I've gotten my syntax close (but not
quite) where it needs to be.
What I am doing: trying to load a variety of usercontrols programtically and
then assigning property values to them.
What I have:
I created a baseclass for these controls that will be loaded:
-------------------------
Public Class BaseLoadedControl
Inherits System.Web.UI.UserControl
public siteID as String
End Class
-------------------------
Then, in my usercontrol that I am using to then load one of these controls,
I have this:
-------------------------
dim customContentControl as BaseLoadedControl
customContentControl = CType(Page.LoadControl(thecontrol),
BaseLoadedControl)
'theControl = the string of the specific control I am loading...such as
sample.ascx
-------------------------
The problem is that gives me an 'invalid cast' error.
So, once again, I'm stuck. Anyone see where my logic and/or syntax may be
off?
-Darrel