Please try:
In aspx.cs:
public void addButton()
{
Response.Write("<input type="button" önclick="setText();" value="Click Me" /> <br />");
}
public void addTextBoxes()
{
for (int i = 0; i < 10; i++)
{
Response.Write("<input id="txt" + i.ToString() + "" type="textbox" /> <br />");
}
}
In aspx:
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function setText(){
form1.txt0.value = 'textbox0';
form1.txt1.value = 'textbox1';
}
</script>
</head>
<body>
<form id="form1" runat="server">
<%addButton(); %>
<%addTextBoxes(); %>
</form>
</body>
Regards.
Andy