0

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

  • What do you mean `however it is not working`? Is there an error, or visually it's not showing up correctly? Have you had success using `RenderControl` to output simple `

    Hello World?

    `?
    – James Jul 25 '12 at 13:20
  • It's visually not showing up; nothing happens to the placeholder, it just remains empty - also when I try to only render "hello world". I put the placeholder in a tag. Can it have anything to do with that? – Frederik Brinck Jensen Jul 25 '12 at 13:51
  • Solved by using an XSLT macro instead referring to this question: http://stackoverflow.com/questions/4845660/xsl-how-to-split-strings – Frederik Brinck Jensen Jul 29 '12 at 08:55

0 Answers0