I know why you cannot access the title property. The return type of @category.Content is IPublishedElement. Like the error says: This type does not have a property 'Title'. You have to explicitly tell the compiler that this is a CategoryBlock. You can do that with a type cast
How to use the @Model?
I have "test" variable that has the following properties:
Can someone please explain to me why test.Title gives this error:
Here is the full code snippet:
Hi there!
I know why you cannot access the title property. The return type of @category.Content is
IPublishedElement
. Like the error says: This type does not have a property 'Title'. You have to explicitly tell the compiler that this is a CategoryBlock. You can do that with a type castCast type or use the .Value method.
is working on a reply...