Hello!
I`ve created data type based on Dropdown list with three prevalues and included it in my document type. Now I need to create this document from my code on C# and set value for this property. There are some textstring properties in the document type and I have no problem with them. But when I`m trying to set dropodown list property:
Code:
Document d = new Document(pageId);
Document q = null;
User admin = new User(0);
q = Document.MakeNew("question_" + (lastQuestionNumber+1), DocumentType.GetByAlias("M Question"), admin, d.Id);
if (q != null)
{
q.getProperty("questionContent").Value = txtboxQuestion.Text;
q.getProperty("EnquirerId").Value = m.Id;
q.getProperty("EnquirerName").Value = "temp";
q.getProperty("EnquirerGroupName").Value = "Students"; // problem here
q.Publish(admin);
umbraco.library.PublishSingleNode(q.Id);
Response.Redirect(umbraco.library.NiceUrl(d.Id), true);
}
Textstring properties "questionContent", "EnquirerId" are published right, but "EnquirerGroupName" is saved as "<![CDATA[]]>" in the umbraco.config. When I publish this page through admin interface this property saves as "<![CDATA[Students]]>".
How should I get values from my Data Type (DropDownList) to publish document programmaticaly?
Thanks!
Igor Bel