November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
(PageReference)CurrentPage["NewsContainer"]
Second, you are using three for-loops to add all the results from your GetChildren calls into the PageDataCollection "News". These loops are not necessary, as you can use the PageDataCollection.Add(...) method to add entire collections at once.
So I believe your code could be compacted into something like this (untested):
PageDataCollection News = new PageDataCollection();
News.Add(GetChildren((PageReference) CurrentPage["NewsContainer"]));
News.Add(GetChildren((PageReference) CurrentPage["MetalStructuresNewsContainer"]));
News.Add(GetChildren((PageReference) CurrentPage["FastenersNewsContainer"]));
News.Sort(...) etc etc
Note: If you'd like to make sure your properties contain values before trying to typecast or access them (to prevent from null reference exceptions and similar), PageBase offers an IsValue("PropertyName") method that should be checked before accessing/using property values to add robustness.
To return to your first attempt at solving this, something like the following (again, untested) should be able to handle it from the aspx file:
etc etc
Just make sure the controls are data bound (call from code-behind), and the above should work. If you'd like to add custom sorting etc, you can still do that from the code-behind (or use the SortOrder or SortBy/SortDirection attributes of the NewsList tag).
<%#striphtml(container.currentpage.property["pagename"].tostring(),maxcharactersincorpnews())%>%#striphtml(container.currentpage.property["pagename"].tostring(),maxcharactersincorpnews())%>