I'm creating a umbraco website where the user can login. On this login page I want to show him/her the workshops the user signed up for. That is done through a user control. If the user has registered for any workshops, it should create table-rows matching with the number of workshops - if not, the usercontrol should display a simple message.
I'm outputting the table-rows with htmlTextWriter, however it is not working. Currently my code is as follows:
'foreach loop
writer.AddAttribute(HtmlTextWriterAttribute.Class, "standard-content");
writer.RenderBeginTag(HtmlTextWriterTag.Tr);
writer.AddAttribute(HtmlTextWriterAttribute.Class, "workshop-availability-name");
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.Write(nodeName);
writer.RenderEndTag();
writer.AddAttribute(HtmlTextWriterAttribute.Class, "workshop-availability-date");
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.RenderBeginTag(HtmlTextWriterTag.Strong);
writer.Write(umbraco.library.FormatDateTime(nodeStartDate.ToString(), "dd-MMM-yy"));
writer.RenderEndTag();
writer.Write(" to ");
writer.RenderBeginTag(HtmlTextWriterTag.Strong);
writer.Write(umbraco.library.FormatDateTime(nodeEndDate.ToString(), "dd-MMM-yy"));
writer.RenderEndTag();
writer.RenderEndTag();
writer.AddAttribute(HtmlTextWriterAttribute.Class, "workshop-availability-more");
writer.RenderBeginTag(HtmlTextWriterTag.Td);
writer.AddAttribute(HtmlTextWriterAttribute.Src, nodeUrl);
writer.RenderBeginTag(HtmlTextWriterTag.A);
writer.Write("Read more...");
writer.RenderEndTag();
writer.RenderEndTag();
'foreach end
And then I'm outputting it to a placeholder:
RegisteredWorkshops.RenderControl(writer);
But the placeholder is empty whenever I run the site. How can I get to display these dynamic rows within the a table on my page based upon the registration of workhops?
Best regards, brinck10
Hello World?
`? – James Jul 25 '12 at 13:20