If you want to do in client side then
1. Add onclick event handler in checkbox (javascript)
function clicked(objCheckBox)
{
document.getElementById("<% =TextBox2.ClientID %>").value = document.getElementById("<% =TextBox1.ClientID %>").value;
}
2. Add onclick event handler to checkbox
CheckBox1.Attributes.Add("onclick", "clicked(this)");
If you want to do in server side then simply add CheckChanged event
<asp:CheckBox ID="CheckBox1" runat="server"
oncheckedchanged="CheckBox1_CheckedChanged" />
And in aspx.cs page
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
TextBox2.Text = TextBox1.Text;
}