yes, I have changed . it is displaying error again. Can you share me, What is the mistake here
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Umbraco.Web.PublishedContentModels.Tekst' does not contain a definition for 'GetPropertyValue'
Compiler Error Message: CS1061:Umbraco.Web.Models.RenderModel 'does not contain a definition for' id 'and an extension' id 'was not found that accepts a first argument of the type' Umbraco.Web.Models.RenderModel '(do you need a' using ' 'directive or a assembly reference?)
Getting some error
Hi,
I have written this code, now i am getting some error , i can not understand , can you please help me. Can you please look at my code.
Error Output:
Compiler Error Message: CS0446: Foreach can not perform actions on a 'method group'. Did you want to call 'method group'?
Hi Jhon,
you are missing the
.Content
part again in your code:Hope this helps!
/Michaël
yes, I have changed . it is displaying error again. Can you share me, What is the mistake here
Exception Details: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Umbraco.Web.PublishedContentModels.Tekst' does not contain a definition for 'GetPropertyValue'
See output error
This is my document type
Hi Jhon,
you use the dynamics type for your
node
object.Change it to
IPublishedContent
then you will have the methodGetPropertyValue
.Hope this helps!
/Michaël
yes , i am using dynamics. where should i change. I am little bit confused.Can you please tel me, where.
Jhon,
chance this line:
to:
Hope this helps!
/Michaël
Thank you. it is coming output but it is displying wrong .
Can you please look at my output.
Hi Jhon,
you need to add an
@
before the if statement:Hope this helps!
/Michaël
yes , if i add @ , it is displaying error
Compiler Error Message: CS1061:Umbraco.Web.Models.RenderModel 'does not contain a definition for' id 'and an extension' id 'was not found that accepts a first argument of the type' Umbraco.Web.Models.RenderModel '(do you need a' using ' 'directive or a assembly reference?)
Jhon,
use
Model.Id
where Id needs to be camelcase.Hope this helps!
/Michaël
Hi,
I have changed . again it is displaying error
Compiler Error Message: CS0019:The operator '==' can not be used with operands of the types 'method group' and 'int'
Use
Model.Content.Id
.Always remember, the
Model.Content
is the object that contains the current page.Hope this helps!
/Michaël
Yes , thank you , So many difference in umbraco 4 and umbraco 7. nice forum to learn.
No problem!
Glad you solved it.
Have a nice day.
/Michaël
is working on a reply...