How can I load another usercontrol from a visible usercontrol, who is available in the Default.aspx?
<p>How can I load another usercontrol from a visible usercontrol, who is available in the Default.aspx? </p>

<p>I select in that case a name of page from a DropDownList. </p>

<p>After this event the visible usercontrol will be replaced by the selected usercontrol.</p>

<p>The source in Default.aspx</p>

<pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
    &lt;div&gt;
        &lt;br /&gt;
        &lt;asp:PlaceHolder runat="server" ID="PlaceholderAddressTemplate" &gt;&lt;/asp:PlaceHolder&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="lblUser" runat="server"&gt;&lt;/asp:Label&gt;
    &lt;/div&gt;
&lt;/asp:Content&gt;
</code></pre>

<p>in Default.aspx.cs
...</p>

<pre><code>PlaceholderAddressTemplate.Controls.Clear();

int iIndex = Functions.GetItem(PageIndex);

_Address = null;

switch (iIndex)
{
   case 1: _Address = (uclFirst)Page.LoadControl("~/UserControls/uclFirst.ascx"); break;
   case 2: _Address = (uclSecond)Page.LoadControl("~/UserControls/uclSecond.ascx"); break;
   default: _Address = (uclHome)Page.LoadControl("~/UserControls/uclHome.ascx"); break;
}
</code></pre>

<p>PlaceholderAddressTemplate.Controls.Add(_Address);</p>

<p>and in uclHome.ascx.cs something like this...</p>

<pre><code>protected void OnSelectedIndexChanged(object sender, EventArgs e)
{
    (Default)this.Parent.Page. _default = new Default();
   // _default.Page
    Example1.Text = ddlNames.Items[ddlNames.SelectedIndex].ToString();
}
</code></pre>

<p>Thanks...</p>
