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 102535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:58:51+00:00 2026-05-11T00:58:51+00:00

This is related to my earlier question , but I thought I’d simplify it

  • 0

This is related to my earlier question, but I thought I’d simplify it and make a challenge out of it. Given the code below, can you change the value of ‘ChangeThisLabel’ from the code behind?

<asp:ListView ID='OuterListView' runat='server'>     <LayoutTemplate>         <asp:PlaceHolder ID='itemPlaceHolder' runat='server' />     </LayoutTemplate>     <ItemTemplate>         <%#Eval('outer_value')%> <br/>         <asp:ListView ID='InnerListView' runat='server' DataSource='<%#Eval('inner') %>'>             <LayoutTemplate>                 <asp:Label ID='ChangeThisLabel' runat='server' />                 <asp:PlaceHolder ID='itemPlaceHolder' runat='server' />             </LayoutTemplate>             <ItemTemplate>                 <%#Eval('inner_value')%> <br/>             </ItemTemplate>         </asp:ListView>     </ItemTemplate> </asp:ListView> 

I would suggest trying it yourself before submitting an answer, as I got a lot of suggestions in my earlier post that work fine for a single ListView, but fall down when going up against the nested ListView.

  • 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. 2026-05-11T00:58:52+00:00Added an answer on May 11, 2026 at 12:58 am

    as it was mentioned in the other answer. in the code behind, on load, you can do this:

    `OuterListView.FindControl('InnerListView').FindControl('ChangeThisLabel') 

    then cast it as a label and change the text. obviously you would iterate this code inside a loop so you do it for every label in ever inner list view of every outside list view.

    And regarding answers to your other question, you were not clear that you wanted to access it from the code behind. Also you might want to post what you have tried, so that people know that you have tried different methods.

    good luck!

    edit: regarding your comment:

    Unless I’m missing something, this will not work, because ‘ChangeThisLabel’ becomes ‘ctl00_ctl00_BodyContentPlaceHolder_ReportContentPlaceHolder _OuterListView_ctrl0_InnerListView_ChangeThisLabel’ when it’s rendered by the inner ListView

    you are correct, but when you use FindControl(id), it will use the server side id to find the control. if you do: InnerListView.FindControl(‘ChangeThisLabel’) then it will find the right label regardless of the client side ID assigned to that control.

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

Sidebar

Related Questions

This is closely related to an earlier question . In the managed world: How
This is related to the this question and the answer maybe the same but
This is related to an earlier question by a different user, asking How to
The answers to this related question of mine lead me to choose Java for
This is related to a chapter from beautiful code . And in that chapter
This is related to a question I asked the other day on how to
This is related to this question . I'm writing a Flex app (a WindowedApplication)
I've spent a while on this but can't get this to work, I apologize
This relates to another question I asked earlier today. I built SVN 1.6.2 from
This is related to the accepted answer for What’s your #1 way to be

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.