You have to make the web controls on the user control public.
Here's a quick example showing how to change a user control's textbox from the parent page:
WebUserControl1.ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="WebApplication1.WebUserControl1" %>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
WebUserControl1.ascx.cs:
using System;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class WebUserControl1 : System.Web.UI.UserControl
{
public TextBox UserControlTextBox1
{
get { return TextBox1; }
set { TextBox1 = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
WebForm1.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<%@ Register src="WebUserControl1.ascx" tagname="WebUserControl1" tagprefix="uc1" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<uc1:WebUserControl1 ID="WebUserControl11" runat="server" />
</div>
</form>
</body>
</html>
WebForm1.aspx.cs:
using System;
namespace WebApplication1
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
WebUserControl11.UserControlTextBox1.Text = "Your text here...";
}
}
}