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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:58:30+00:00 2026-06-07T13:58:30+00:00

I have the following snippet getting control ids in a listview at runtime. However

  • 0

I have the following snippet getting control ids in a listview at runtime. However ctrl is null when debugged in spite of the correct id being provided.

 foreach (ListViewItem item in lvData.Items)
 {
    string uid = item.ClientID;
    Control ctrl = lvData.FindControl(uid+"_lbUnattend");
    ctrl.Visible = false;
 }

my template:

 <asp:ListView runat="server" ID="lvData" DataSourceID="odsEvents" 
        OnDataBound="lvData_DataBound" 
        onselectedindexchanged="lvData_SelectedIndexChanged">
        <LayoutTemplate>
            <table class="diary" cellspacing="0" width="600px">
                <tr>

                    <th align="center">
                        Date:
                    </th>
                    <th align="center">
                        Time:
                    </th>
                    <th align="center">
                        Event:
                    </th>
                    <th align="center">
                        Location:
                    </th>
                    <th align="center">
                    </th>
                </tr>
                <tr runat="server" id="itemPlaceHolder">
                </tr>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td width="100px" align="center">
                    <%#FRT.Utils.DateTimeHelper.FormatToShortDate(Eval("StartDate"))%>
                    <%#FRT.Utils.DateTimeHelper.FormatToShortDate(Eval("VisitDateStart"))%>
                </td>
                <td width="100px" align="center">
                    <%#FRT.Utils.DateTimeHelper.FormatToShortTime(Eval("StartDate"))%>
                    <%#FRT.Utils.DateTimeHelper.FormatToShortTime(Eval("VisitDateStart"))%>
                </td>
                <td width="100px" align="center">
                    <%#Eval("Title")%>
                </td>
                <td width="200px" align="center">
                    <%# Eval("Address") %>
                </td>
                <td width="100px" align="center">
                 <asp:LinkButton ID="lbLogin" runat="server" Text="I want to attend this event" CssClass="button" />
                 <asp:LinkButton ID="lbAttend" runat="server" Text="I want to attend this event" CssClass="button" />
                 <asp:LinkButton ID="lbUnattend" runat="server" CommandName="unattend" Text="I want to unregister from this event" CssClass="button" />
                 <a href='<%# GetItemUrl(Eval("ActivityID"), Eval("SubEventID")) %>' class="button">See details</a>&nbsp
                </td>
            </tr>
        </ItemTemplate>
 </asp:ListView>

where linkbuttons whith ids generated from lbUnattend are the ones I want.

Anyone pointout where the problem is?

  • 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-06-07T13:58:32+00:00Added an answer on June 7, 2026 at 1:58 pm

    I think what you’re looking for is

    foreach (ListViewItem item in lvData.Items)
    {
        Control ctrl = item.FindControl("lbUnattend");
        ctrl.Visible = false;
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code snippet but I am getting wrong output. class Program {
I have following code snippet that i use to compile class at the run
I have following code snippet: class ABC{ public: int a; void print(){cout<<hello<<endl;} }; int
I have the following snippet of code: import csv def has_header(first_lines): sniffer = csv.Sniffer()
We have the following snippet. OSStatus createErr = PasteboardCreate(kPasteboardClipboard, &m_pboard); if (createErr != noErr)
I have the following snippet from my code: switch ($extention) { case gif: $src
I have the following snippet of java code: File directoryToMoveTo = new File(file.getParent()+_TEMP); boolean
I have the following snippet in my pom.xml (Full pom attached below which can
I have the following snippet of code (I'm using jQuery 1.4.2): $.post('/Ads/GetAdStatsRow/', { 'ad_id':
I have the following (snippet) of a kernel. __global__ void plain(int* geneVec, float* probs,

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.