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 510k
  • Answers 510k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The SGI Standard Template Library (STL) documentation explains all of… May 16, 2026 at 4:53 pm
  • Editorial Team
    Editorial Team added an answer I had this problem. What a pain. To properly destroy… May 16, 2026 at 4:53 pm
  • Editorial Team
    Editorial Team added an answer This line right here: window.setTimeout(callbackFunction(aAlbums), 5000); You're calling the function… May 16, 2026 at 4:53 pm

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 when comparing 2 strings values using C:When tag I am
I am facing a problem where-in I cannot select videos from the photo album
I am facing a strange problem in cakePHP. The issue is when ever i
I have a need to run some automation tasks in a web browser control
I believe this question applies to any of the For Html helpers, but my
I moved my code to use std::vector<char> instead of char *mem = malloc(...) but
I need to set up multiple Sessionfactories in my app, now I'm facing a
I would like to build the latest version of PDFBox ( http://pdfbox.apache.org/userguide/dot_net.html ) for
I am currently facing a scenario that I am unsure what is the best

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.