<%@ Page %>
<%@ Reference Control="control.ascx" %>
<script runat="server" language="C#">
void Page_Load(Object sender, EventArgs e)
{
Control sampleControl = LoadControl("Control.ascx");
Controls.Add(sampleControl);
}
</script>
C# version (control.ascx)
<%@ Control Language="C#" %>
<script runat="server" language="C#">
void Page_Load(Object sender, EventArgs e)
{
AuthorLabel.Text = "Sample Control Text";
}
</script>
<h3><asp:Label id="AuthorLabel" runat="server" />
|