The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
UmbracoMedia
Posted by: MR | February 18, 2011 @ 4:13am
C# Code
[
Download
]
protected void Fill() { Node myNode = Node.GetCurrent(); if (myNode.GetProperty("galleryFolder").Value != null) { String galleryFolderIdString = myNode.GetProperty("galleryFolder").Value; Int32 _thisgalleryFolderId = 0; Int32.TryParse(galleryFolderIdString, out _thisgalleryFolderId); if (_thisgalleryFolderId > 0) { GalleryFolderId = _thisgalleryFolderId; Node galleryFolder = new Node(GalleryFolderId); if (galleryFolder != null) { List<Node> children = new List<Node>(); AddChildNodes(children, galleryFolder); try { var images = (from i in children select new { ImageNodeId = i.Id, ImgSrc = new Media(i.Id).getProperty("umbracoFile").Value.ToString() ?? "", }); if (images.Count() > 0) { rep_images.DataSource = images; rep_images.DataBind(); } } catch (Exception ex) { //Response.Write(ex.ToString()); } } } } } public void AddChildNodes(List<Node> list, Node parentNode) { foreach (Node child in parentNode.Children) { list.Add(child); AddChildNodes(list, child); } }
Syntax Highlighting
[
Open in new window
]
Author Comments
The above doesn't work.
Rating
4.09 / 8
118 Votes