Problem with Literals and ViewState
<p>I am trying here to create a module linked to a webhosting cart process.</p>

<p>The first step should have a textfield with an "add" button. This button checks the availability of a domain and add it to a list.</p>

<p>The goal here is to basically display the list of domain verified and give proper action as radioboxes (register if it is free, transfert otherwise or point the domain directly).</p>

<p>So basically I check the availability and then add a literal control in a placeholder.</p>

<p>The problem with that is the viewstate (when I step forward and backward I lose the choices I had made with the domains).</p>

<p>the html : </p>

<pre><code>( ... )
        &lt;asp:MultiView ID="mvFlow" runat="server" ActiveViewIndex="0"&gt;
      &lt;asp:View ID="vDomain" runat="server" onactivate="vDomain_Activate"&gt;

       &lt;asp:TextBox ID="txtDomain" runat="server" style="margin-bottom: 0px" 
        Width="254px"&gt;&lt;/asp:TextBox&gt;
        &amp;nbsp;&lt;asp:Button ID="domainAdd" runat="server" onclick="domainAdd_Click" 
        style="height: 26px" Text="Ajouter" /&gt;
       &amp;nbsp;&lt;br /&gt;
       &lt;br /&gt;
       &lt;asp:PlaceHolder ID="phDomainResults" runat="server"&gt;&lt;/asp:PlaceHolder&gt;
       &lt;br /&gt;
       &lt;br /&gt;
       &lt;asp:LinkButton ID="lbDomainSkip" runat="server" onclick="lbDomainSkip_Click"&gt;Prochaine 
       étape »&lt;/asp:LinkButton&gt;

      &lt;/asp:View&gt;
( ... )
</code></pre>

<p>behind it's basically something like this : </p>

<p>lt.Text =</p>

<pre><code>     "&lt;dl&gt;" +
      "&lt;dt&gt;&lt;strong&gt;" + txtDomain.Text + "&lt;/strong&gt; &lt;span style='color:green;'&gt;Le domaine est disponible&lt;/span&gt;&lt;/dt&gt;" +
      "&lt;dd&gt;&lt;input type='radio' name='" + txtDomain.Text.Replace('.', '_') + "_action' value='register' /&gt; Register&lt;/dd&gt;" +
      "&lt;dd&gt;&lt;input type='radio' name='" + txtDomain.Text.Replace('.', '_') + "_action' value='transfert' disabled='disabled' /&gt; Transfert&lt;/dd&gt;" +
      "&lt;dd&gt;&lt;input type='radio' name='" + txtDomain.Text.Replace('.', '_') + "_action' value='point' /&gt; Point&lt;/dd&gt;" +
     "&lt;/dl&gt;";
</code></pre>

<p>There must be possible to make things more logical and easy ?</p>

<p>Following suggestion I did this : </p>

<pre><code>LiteralControl lt = new LiteralControl();
RadioButtonList rl = new RadioButtonList();

lt.Text = "&lt;strong&gt;" + txtDomain.Text + "&lt;/strong&gt; &lt;span style='color:green;'&gt;Le domaine est disponible&lt;/span&gt;";
rl.Items.Add(new ListItem { Enabled = true, Selected = true, Text = "Enregistrement", Value = "register" });
rl.Items.Add(new ListItem { Enabled = false, Selected = false, Text = "Transfert", Value = "transfert" });
rl.Items.Add(new ListItem { Enabled = true, Selected = false, Text = "Pointer moi même", Value = "point" });
//phDomainResults is a PlaceHolder in the page
phDomainResults.Controls.Add(lt);
phDomainResults.Controls.Add(rl);
</code></pre>

<p>Doesn't seem to work more...</p>
