title: ASP.NET controls generated from XSLT do not show up in panel added as a literal control
body: <p>I have the following code:</p>
  
  <pre><code>   XElement Categories =
                         new XElement("Promotions",
                             from b in db.GetPromotions()
                          select new XElement("Promotion",
                              new XElement ("Category",b.CategoryName),
                                 new XElement("Client",b.ClientName),
                                 new XElement("ID",b.ID),
                                 new XElement("Title",b.Title)));
  
                      XDocument mydoc = new XDocument();
                      mydoc.Add(Categories);
  
                      try
                      {
                              // Load the style sheet.
                              XslTransform xslt = new XslTransform();
                              xslt.Load(@"C:\Web\DesktopModules\Promotions\TransList.xslt");
  
                              // Execute the transform and output the results to a writer.
                              StringWriter sw = new StringWriter();
                              //XsltSettings mysettings = new XsltSettings();
                              XmlWriterSettings mysettings = new XmlWriterSettings();
  
                              xslt.Transform(mydoc.CreateReader(),null, sw);
  
                              String mstring = sw.ToString();
  </code></pre>
  
  <p>It generates the following string:</p>
  
  <pre><code>&lt;ul id="red" class="treeview-red" xmlns:asp="http://schemas.microsoft.com/ASPNET/20"&gt;
    &lt;li&gt;&lt;span&gt;Arts &amp;amp; Entertainment&lt;/span&gt;&lt;ul&gt;
        &lt;li&gt;&lt;span&gt;Client 1&lt;/span&gt;&lt;ul&gt;
            &lt;li&gt;&lt;span&gt;&lt;asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkClicked" Text="Get your Free 2" /&gt;&lt;/span&gt;&lt;/li&gt;
            &lt;li&gt;&lt;span&gt;&lt;asp:LinkButton ID="LinkButton4" runat="server" OnClick="LinkClicked" Text="Get your Free 4" /&gt;&lt;/span&gt;&lt;/li&gt;
            &lt;li&gt;&lt;span&gt;&lt;asp:LinkButton ID="LinkButton5" runat="server" OnClick="LinkClicked" Text="Get your Free 5" /&gt;&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;span&gt;Community &amp;amp; Neighborhood&lt;/span&gt;&lt;ul&gt;
        &lt;li&gt;&lt;span&gt;Client 2&lt;/span&gt;&lt;ul&gt;
            &lt;li&gt;&lt;span&gt;&lt;asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkClicked" Text="Get your Free 1" /&gt;&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;span&gt;Education&lt;/span&gt;&lt;ul&gt;
        &lt;li&gt;&lt;span&gt;Client 3&lt;/span&gt;&lt;ul&gt;
            &lt;li&gt;&lt;span&gt;&lt;asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkClicked" Text="Get Your Free 3" /&gt;&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;&lt;span&gt;Home &amp;amp; Garden&lt;/span&gt;&lt;ul&gt;
        &lt;li&gt;&lt;span&gt;Client 4&lt;/span&gt;&lt;ul&gt;
            &lt;li&gt;&lt;span&gt;&lt;asp:LinkButton ID="LinkButton6" runat="server" OnClick="LinkClicked" Text="Get your Free 6" /&gt;&lt;/span&gt;&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Now I take the string and add it to a panel which is part of a view in a multiview control:</p>
  
  <pre><code>Panel1.Controls.Add(new LiteralControl(mstring));
  </code></pre>
  
  <p>I have tried to play with Page.ParseControl, but I cannot get it to work right in the panel, the linkbuttons do not show, even though the text is there in the source. Any suggestions are quite welcome.</p>
  
  <p>Thanks In Advance</p>
  
  <p>Now I tried this:</p>
  
  <pre><code>Control myctrl = Page.ParseControl(mstring);         
  Panel1.Controls.Add(myctrl);
  </code></pre>
  
  <p>and I get this as the one of the controls:</p>
  
  <pre><code>a id="dnn_ctr954_ViewPromotions_LinkButton2" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&amp;quot;dnn$ctr954$ViewPromotions$LinkButton2&amp;quot;, &amp;quot;&amp;quot;, true, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, false, true))"&gt;Get your Free 2&lt;/a&gt;
  </code></pre>
  
  <p>It doesn't work the way expected, dotnetnuke is doing some nutty stuff here using the parse control. it seems to drop my LinkClicked event.</p>