Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6473265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:26:45+00:00 2026-05-25T06:26:45+00:00

without the repeater this works, but writing this inside repeater it’s just compile error

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:26:45+00:00Added an answer on May 25, 2026 at 6:26 am

    You can only use DataBind syntax inside a ItemTemplate <%# %>. If you want to refer to another control use the NamingContainer.

    <asp:Repeater runat="server" ID="rep1">
        <ItemTemplate>
          <li>
              <o:TextBox runat="server" ID="txtLastName" />
              <%# Container.FindControl("txtLastName").ClientID %>    
              <o:TextBox runat="server" ID="txtName"  />
           </li>
         </ItemTemplate>
    </asp:Repeater>
    

    Otherwise you can always hook ItemDataBound to manipulate the control on the server-side.

    protected void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {       
       if (e.Item.ItemType == ListItemType.Item 
                    || e.Item.ItemType == ListItemType.AlternatingItem)
       {
           var txtLastName = e.Item.FindControl("txtLastName") as TextBox;
           var txtName = e.Item.FindControl("txtName") as TextBox;
    
           ...
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this could probably be done without regular expressions, but I'd rather make
Without thinking about it at all I just want to say I should allow
I have a Repeater nested inside of a GridView . On the RowDataBound event
I know you can can do this using MVC. But not sure if you
I have an ASP.NET page that uses a repeater nested within another repeater to
I'm trying to use the repeat without binding it to a datasource, is this
Sorry, this question might sound silly, but I need some help! My project is
I'm implementing an API using authentication based on this article: http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/ And this related
I haven't seen this addressed yet, but I think that might be because I
this is my first question, but I've readed StackOverflow for years. Well the thing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.