SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can someone tell me how I can load a user control from within another user control.

I'm using MOSS 2007

share|improve this question

I got the following code from the MDSN on line libray:

<%@ Page Language="C#" %>
<%@ Reference Control="~/Controls/Spinner.ascx" %>
<script runat="server">
private ASP.Spinner Spinner1
protected void Page_Load(object sender, EventArgs e)
  Spinner1 = (ASP.Spinner)LoadControl("~/Controls/Spinner.ascx");
protected void Button1_Click(object sender, EventArgs e)

<asp:PlaceHolder runat="server" ID="PlaceHolder1" />
<br />
<asp:Button ID="Button1" runat="server" Text="Click to Add User Control" OnClick="Button1_Click" />

basically you have to load the new control code behind and attach it in a place older so you have to set a PlaceHolder in the first control or something that can contains the Child-Control

This is the MSDN ref:

share|improve this answer
no working thanks but no thank you – Mathematics May 9 '13 at 15:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.