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 written this code. it is displaying error. Can you please help me.
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @using System.Globalization; @{ int number1 = Convert.ToInt32(@Parameter.rowNum1); int number2 = Convert.ToInt32(@Parameter.rowNum2); var top3News = Model.Content.Descendants().Where(x => x.DocumentTypeAlias == "Arrangement" || x.DocumentTypeAlias == "nyhed" && orderDate != "Null"); string caption = ""; int chars = 0; int counter = 0; var cnt = 0; } @foreach(var newsNode in top3News) { if (newsNode.Content.HasValue("orderDate")) { if(newsNode.IsNull("startTime")) { cnt += 1; } sortedNodes.Add(newsNode); } } sortedNodes = sortedNodes.OrderBy("orderDate desc").Skip(number1).Take(number2); <div class="newsWidthRow"> <div class="newsRow row"> @foreach (var page in sortedNodes) { counter += 1; if (page.Content.HasValue("startTime")) { var startTime = @page.startTime; var endTime = @page.endTime; if (startTime.Day == endTime.Day) { caption = page.GetPropertyValue<DateTime>("startTime").ToString("d. MMMM", CultureInfo.CreateSpecificCulture("da-DK")); caption += " - " + page.GetPropertyValue<DateTime>("endTime").ToString("H:mm", CultureInfo.CreateSpecificCulture("da-DK")); } else { caption = page.GetPropertyValue<DateTime>("startTime").ToString("d. MMMM", CultureInfo.CreateSpecificCulture("da-DK")); caption += " - " + page.GetPropertyValue<DateTime>("endTime").ToString("d. MMMM", CultureInfo.CreateSpecificCulture("da-DK")); } } else { caption = ""; } if (top3News.Last().Id == page.Id) { <div class="newsColumn col-xs-6 col-sm-6 col-md-6 col-lg-4" style="border-bottom: none;margin-bottom:0;padding-bottom:0;"> } else { <div class="newsColumn col-xs-6 col-sm-6 col-md-6 col-lg-4"> } <div class="newsInner"> <a href="@page.Url"> <div class="newsTitle"> <p style="font-weight: bold;letter-spacing: 0.4px;font-size: 11px;color: grey;">@page.orderDate.ToString("dd.MM.yyyy")</p> <h1>@page.GetPropertyValue("title")</h1> <h2 style="font-weight: bold;font-size: 15px;margin-top: 8px;margin-bottom: 8px;color: black;">@page.GetPropertyValue("subtitle")</h2> </div> </a> <div style="clear: both;"></div> <div style="margin-top: 9px;"> <a class="dont_underline" href="@page.Url"> <div class="newsTeaser"> <p>@page.GetPropertyValue("teaser")</p> </div> </a> </div> <br/> </div> </div> caption = ""; } </div> </div>
see error output:
var top3News = Model.Content.Descendants().Where(x => x.DocumentTypeAlias == "Arrangement" || x.DocumentTypeAlias == "nyhed" && orderDate != "Null");
where is orderDate declared?
sortedNodes.Add(newsNode);
same for sortedNodes
I'm guessing you are mainly using dynamics?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Error output
Hi
I have written this code. it is displaying error. Can you please help me.
see error output:
where is orderDate declared?
same for sortedNodes
I'm guessing you are mainly using dynamics?
is working on a reply...