Custom Object Property Types
Posted on 2011-05-10
I have created a Structure called PageType for a custom control
so far I can programmatically assign by using
myControl.PageType = PageTypes.HomePage
but i'm trying to set the value on the page
<uc:MyPage runat="server" id="myControl" PageType="HomePage" />
but I get the error
"Cannot create an object of type 'PageTypes' from its string representation 'HomePage' for the 'PageType' property."
So it seems it is treating the value HomePage as a string when it is expecting a PageType but I don't know how to set this directly on the object. In visual studio if I take a textbox and type ForeColor=, it shows everything in System.Drawing.Color but I dont get anything when I type PageType= so I assume its related.