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

  • SEARCH
  • Home
  • 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 938387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:38:08+00:00 2026-05-15T21:38:08+00:00

I am facing a problem with access to HTML elements. On the server side

  • 0

I am facing a problem with access to HTML elements. On the server side those elements exists in itemTemplate of a repeater control.

simple code:

    <asp:Repeater ID="rptList" runat="server" onitemcreated="rptList_ItemCreated">
    <HeaderTemplate>
               <div id="accordionGiftLelo">
    </HeaderTemplate>
    <ItemTemplate>


                         <div class="set">
                         <div class="title"><img src='<%# Eval("TitleImgUrl")%>'  runat="server" width="198" height="29"  /></div>
                         <div ID="RepeaterBG" class="content"  style="background-color:<%# Eval("ContentBackground")%>">
                             <%--<a href='<%# Eval("ContentUrl")%>'><img src='<%# Eval("ContentImgUrl")%>' alt="Embroidered Devil Eyes" width="198" height="198" border="0" /></a>--%>
                             <div style="width:198"><asp:Literal ID="Literal1" runat="server"  Text='<%# Eval("ContentImgUrl")%>'></asp:Literal></div>
                         </div>
                         </div>

    </ItemTemplate>

    <FooterTemplate>
                         </div>
    </FooterTemplate>

    </asp:Repeater>

How can I access RepeaterBG div for example?

  • 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-15T21:38:09+00:00Added an answer on May 15, 2026 at 9:38 pm

    Here is an example on how to access controls server side and apply your data to them. Make sure to add the RunAt=”server” to the div tag.

    add a reference for the ItemDataBound event

    rptList.ItemDataBound += rptList_ItemDataBound;
    
    private void rptList_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
    {   
        if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem) return;
    
        HtmlControls.HtmlGenericControl RepeaterBG = (HtmlControls.HtmlGenericControl)e.Item.FindControl("RepeaterBG");
    
        Data.DataRowView dr = (Data.DataRowView)e.Item.DataItem;
    
        RepeaterBG.Style.Add("background-color", dr("ContentBackground"))
    }
    

    You will find that if you do this for ALL of your controls, instead of using “<%# Eval”, you’re code will be much easier to maintain.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think your method is probably fine. Capturing the form's… May 17, 2026 at 8:56 am
  • Editorial Team
    Editorial Team added an answer Are you sure the two values are exactly the same?… May 17, 2026 at 8:56 am
  • Editorial Team
    Editorial Team added an answer You need to pass values to error check. public void… May 17, 2026 at 8:55 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm facing this problem with Java. I want to get some HTML informations from
I am facing problem with an Oracle Query in a .net 2.0 based windows
I am facing a problem with .NET generics. The thing I want to do
I'm facing a problem with IE6. I took the toggle function from this website
I am facing a problem. I would like to localize my action names in
I'm facing a problem while unit testing my forms. The problem is that data
That was helpful kgiannakakis. I'm facing a problem as below: a = ['zbc','2.3'] for
I'm a junior student in IT. I am facing a problem with the output
I'm facing a real problem in understanding how to draw a variable diagram to
I am facing a problem in implementing the search functionality in Table Views... Here

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.