Note that there are some explanatory texts on larger screens.

plurals
  1. POHtmlTextWriter creating table rows dynamically
    primarykey
    data
    text
    <p>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. </p> <p>I'm outputting the table-rows with htmlTextWriter, however it is not working. Currently my code is as follows:</p> <pre><code>'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 </code></pre> <p>And then I'm outputting it to a placeholder:</p> <pre><code>RegisteredWorkshops.RenderControl(writer); </code></pre> <p>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?</p> <p>Best regards, brinck10</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload