Below I have created sample code for you. In this example I have loaded user control in every post back, same thing you have to do.
User Control Code
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication3.WebUserControl1" %>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1"
runat="server" Text="Button" onclick="Button1_Click" />
public partial class WebUserControl1 : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(TextBox1.Text);
}
}
Web Page code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Ajax.aspx.cs" Inherits="WebApplication3.Ajax" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="divControlHolder" runat="server">
</div>
</div>
</form>
<script>
</script>
</body>
</html>
public partial class Ajax : System.Web.UI.Page
{
public string message;
protected void Page_Load(object sender, EventArgs e)
{
LoadControl();
}
private void LoadControl()
{
WebUserControl1 user1 = null;
for (int i = 0; i < 10; i++)
{
user1 = (WebUserControl1)LoadControl("WebUserControl1.ascx");
divControlHolder.Controls.Add(user1);
}
}
}