I have a custom control which has an ITemplate Property to allow the html of the control to be edited by the Umbraco Users rather than hard coded into the control. It works perfectly in a normal .Net aspx page, but when I try and add it into Umbraco as a Macro I am running into problems.
Custom Controls using ITemplate
Hi,
I have a custom control which has an ITemplate Property to allow the html of the control to be edited by the Umbraco Users rather than hard coded into the control. It works perfectly in a normal .Net aspx page, but when I try and add it into Umbraco as a Macro I am running into problems.
If I try to lay it out the same as in .Net:
I get a Parser Error: "Type 'umbraco.presentation.templateControls.Macro' does not have a public property named 'Layout'."
If I try and put the property inline (which isn't what I want it to do, but is what Umbraco tried to do by default):
I get the error "Invalid cast from 'System.String' to 'System.Web.UI.ITemplate'", as the property is being interpreted as Text by the Macro.
Is it possible to use Templated Controls inside Umbraco?
I am using Umbraco version v 4.0.2.1 and the Custom Control is in .Net 3.5.
Many thanks,
Iain
Iain,
You can't use it the way you're using it now, it's not supported (well, you know that already...)
Instead, why can't you have your editors edit the html in a document property and pass that property value to the macro using the following syntax.
If this is not what you're wanting, give us some example of use.
Hope this helps.
Regards,
/Dirk
is working on a reply...