I may have worded the title wrongly here. But what I have is the following user control class:
public class CustomControl : UserControlBase
{
public String MyString { get; set; }
}
When I include an instance of this user control on my page, I can quite easily change the value of MyString in the markup like:
<XYZ:CustomControl runat="server" MyString="A value" />
However, I want to include a property that is of type MyClass, and assign values to the 'child' class:
public class CustomControl : UserControlBase
{
public String MyString { get; set; }
public MyClass MyClass { get; set; }
}
public class MyClass
{
public String AString { get; set; }
}
<XYZ:CustomControl runat="server" MyString="A value" MyClass.AString="Some value" />
Obviously the above won't work, but it gives you an idea of what I'm trying to achieve.