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
Im trying to show all properties adding a variable.
This sentence show the image Url:
<h3>@Umbraco.GetMediaUrl(DynamicModel.Id, "carouselPic1")</h3>
But when i do this i get NOTHING.
@for(int x=1; x<6; x++) { var property = string.Concat("carouselPic", x); @*<h3>test: @Umbraco.GetMediaUrl(DynamicModel.Id, property)</h3>*@ }
Does anyone knows where is the problem? is because the variable isn't the same class of the property?
Thanks a lot
Hi. Hm... As far as I know "@* ---- *@" means a comment. Perhaps you need just to uncomment your "<h3>bla-bla-bla</h3>"?
OOPS! of course, its commented cause when i run it the application crash... just forget the coments ;))
@for(int x=1; x<6; x++) { var property = string.Concat("carouselPic", x); <h3>test: @Umbraco.GetMediaUrl(DynamicModel.Id, property)</h3> }
This still dont work
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Can't get the property when it's a variable
Im trying to show all properties adding a variable.
This sentence show the image Url:
<h3>@Umbraco.GetMediaUrl(DynamicModel.Id, "carouselPic1")</h3>
But when i do this i get NOTHING.
@for(int x=1; x<6; x++)
{
var property = string.Concat("carouselPic", x);
@*<h3>test: @Umbraco.GetMediaUrl(DynamicModel.Id, property)</h3>*@
}
Does anyone knows where is the problem? is because the variable isn't the same class of the property?
Thanks a lot
Hi. Hm... As far as I know "@* ---- *@" means a comment. Perhaps you need just to uncomment your "<h3>bla-bla-bla</h3>"?
OOPS! of course, its commented cause when i run it the application crash... just forget the coments ;))
@for(int x=1; x<6; x++)
{
var property = string.Concat("carouselPic", x);
<h3>test: @Umbraco.GetMediaUrl(DynamicModel.Id, property)</h3>
}
This still dont work
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.