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 am new to umbraco.
I try to create Document type using console application. but it says
Value cannot be null.
public int CreateNewDocumentType(string title, string alias, string description) { User u = new User(0); DocumentType newDocument = DocumentType.MakeNew(u, "aasds"); // newDocument.Alias = alias; newDocument.Description = description; newDocument.IconUrl = "doc.png"; newDocument.Save(); Document.RePublishAll(); return DocumentType.GetByAlias(alias).Id; return 0; }
Thanks
Jivan
Hi Jivan
The document needs an HttpContext so you can't create documents via a Console App. You can use a Webservice though.
Cheers,
Richard
thanks, Richard.
what if i want to create DocumentType?
Does webservice can create Document Type?
Regards
JIvan
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Can not create DocumentType Using console application
HI, I am new to umbraco.
I try to create Document type using console application. but it says
Value cannot be null.
public int CreateNewDocumentType(string title, string alias, string description)
{
User u = new User(0);
DocumentType newDocument = DocumentType.MakeNew(u, "aasds");
// newDocument.Alias = alias;
newDocument.Description = description;
newDocument.IconUrl = "doc.png";
newDocument.Save();
Document.RePublishAll();
return DocumentType.GetByAlias(alias).Id;
return 0;
}
Thanks
Jivan
Hi Jivan
The document needs an HttpContext so you can't create documents via a Console App. You can use a Webservice though.
Cheers,
Richard
thanks, Richard.
what if i want to create DocumentType?
Does webservice can create Document Type?
Regards
JIvan
is working on a reply...