without the repeater this works, but writing this inside repeater it’s just compile error
<asp:Repeater runat="server" ID="rep1">
<ItemTemplate>
<li>
<o:TextBox runat="server" ID="txtLastName" />
<%
//this doesn't works outside of the repeater but here it doesn't
txtName.Text = txtLastName.ClientID;
%>
<o:TextBox runat="server" ID="txtName" />
</li>
</ItemTemplate>
</asp:Repeater>
You can only use DataBind syntax inside a ItemTemplate
<%# %>. If you want to refer to another control use theNamingContainer.Otherwise you can always hook
ItemDataBoundto manipulate the control on the server-side.