//get the document by its ID Document doc = new Document(1029); //Root documents Document.GetRootDocuments(); //Get Nodes of a specific type DocumentType dt = DocumentType.GetByAlias("Textpage"); Content[] docs = Document.getContentOfContentType(dt); //Get documents which has publishing date set //and is either waiting to be published or is expired Document.GetDocumentsForRelease(); Document.GetDocumentsForExpiration();
Error 1 An implicit conversion of the type "umbraco.cms.businesslogic.Content[]" in "System.Web.UI.WebControls.Content[]" is not possible. (translated from german)
I have added references to the cms.dll, businesslogic.dll and umbraco.dll in my project.
I am using Visual Studio 2010 and umbraco v 4.6.1 (Assembly version: 1.0.4029.25836).
You may also want to look into the uComponent project and use uQuery, although you will be restricted to nodes rather than documents (but you should probably be using nodes anyway).
thanks a lot. removing using System.Web.UI.Webcontrols; did not work (type or namespace Content[] can not be found) but your second suggestion works fine.
Enumerate over a collection of documents that are of a particular document type
I am trying to build a .NET usercontrol that populates a dropdown with all nodes of a certain document type. I found this code snippet at the "API Cheatsheet" at
http://our.umbraco.org/wiki/reference/api-cheatsheet/enumerating-documents
but Visual Studio complains this line
with this error:
Error 1 An implicit conversion of the type "umbraco.cms.businesslogic.Content[]" in "System.Web.UI.WebControls.Content[]" is not possible. (translated from german)
I have added references to the cms.dll, businesslogic.dll and umbraco.dll in my project.
I am using Visual Studio 2010 and umbraco v 4.6.1 (Assembly version: 1.0.4029.25836).
What am I missing here?
Christian
Christian,
You're having a namespace clash. You can either remove the line
using System.Web.UI.Webcontrols;
Or try the following line:
You may also want to look into the uComponent project and use uQuery, although you will be restricted to nodes rather than documents (but you should probably be using nodes anyway).
HI Patrick,
thanks a lot. removing using System.Web.UI.Webcontrols; did not work (type or namespace Content[] can not be found) but your second suggestion works fine.
is working on a reply...