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 all
I am currently working on a project that requires listings of both all document types and media types
The following code generates a checkboxlist of document types:
Page Code
<asp:CheckBoxList ID="cblRelatedTypes" runat="server" />
Code Behind
var docTypes = DocumentType.GetAllAsList();docTypes = docTypes.ToList();cblRelatedTypes.DataSource = docTypes;cblRelatedTypes.DataValueField = "Alias";cblRelatedTypes.DataTextField = "Text";cblRelatedTypes.DataBind();
I an however completely stuck on generating the same sort of output for defined Media Types (Image, Folder, File, custom ones, etc).
I could download the Umbraco source and try to track down how it's done, but thought I'd ask here first.
Is someone able to assist in steering me away from the brick wall / sore forehead issue ?
Cheers
Nigel
Hi Nigel,
I think you should be able to do the same, but use this instead:
umbraco.cms.businesslogic.media.MediaType.GetAllAsList()
-Tom
Hi Tom
Back at work now and pleased to confirm you are bang on the mark - makes total sense but sometimes the fog coulds the grey matter (or maybe it's just old age).
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Listing of Media Types
Hi all
I am currently working on a project that requires listings of both all document types and media types
The following code generates a checkboxlist of document types:
Page Code
Code Behind
I an however completely stuck on generating the same sort of output for defined Media Types (Image, Folder, File, custom ones, etc).
I could download the Umbraco source and try to track down how it's done, but thought I'd ask here first.
Is someone able to assist in steering me away from the brick wall / sore forehead issue ?
Cheers
Nigel
Hi Nigel,
I think you should be able to do the same, but use this instead:
-Tom
Hi Tom
Back at work now and pleased to confirm you are bang on the mark - makes total sense but sometimes the fog coulds the grey matter (or maybe it's just old age).
Cheers
Nigel
is working on a reply...