Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I have this very simple loop that I can not get to count 1 up.
Here is my loop
@for(var i =1; i < 5; i++){ <p>@Model.item + @i</p>}
The "item" is a property on a doctypeThe properties are called item1, item2 ,item3, item4
I just need it to spit out the content from my properties.How do I do that? :-)
/Kate
Hi Kate,
Yo can use something like that:
@foreach (var prop in Model.GetType().GetProperties()) { <p>@prop.Value</p> }
Thanks, Alex
HI Alex
Im not sure I can use that, but maybe that is becaurse I dont understand the codeWhat does Model.GetType().GetProperties means?
In my doctype called TekstSide I have these properties
And these are the items that I want to loop through :-)
@for(var i =1; i < 5; i++) { <p>@Model.GetPropertyValue("item" + i)</p> }
Something like that ) Thanks
Yes :-)
Thanks, great help :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Simple for loop
Hi
I have this very simple loop that I can not get to count 1 up.
Here is my loop
The "item" is a property on a doctype
The properties are called item1, item2 ,item3, item4
I just need it to spit out the content from my properties.
How do I do that? :-)
/Kate
Hi Kate,
Yo can use something like that:
Thanks, Alex
HI Alex
Im not sure I can use that, but maybe that is becaurse I dont understand the code
What does Model.GetType().GetProperties means?
In my doctype called TekstSide I have these properties
And these are the items that I want to loop through :-)
Something like that ) Thanks
Yes :-)
Thanks, great help :-)
is working on a reply...