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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:51:24+00:00 2026-05-25T05:51:24+00:00

So I have a asp.net page with a repeater bound to a viewmodel I

  • 0

So I have a asp.net page with a repeater bound to a viewmodel

I want to show/hide a block of HTML based on if the current row property CapAssignedToUserCode is the same as the variable currentUserCode (see if statement)

there is a value in the current row for the property CapAssignedToUserCode and if I hardcode the Eval(“CapAssignedToUserCode”) to a string it all works

I basically want to get the current row of the repeater and pass the property CapAssignedToUserCode to the function commonCap.SameUserCode

<asp:Repeater ID="rptAnnualActionsAssigned" runat="server">
    <ItemTemplate>
        <div class="item">
            <asp:HiddenField ID="hdnCapItemId" runat="server" />
            <h4>
                <%#Eval("CategoryTitle")%>:
                <%#Eval("CategoryIndex")%></h4>
            <span class="status"><strong>Status: </strong>
                <%#Eval("CapAssignedStatus")%></span>
                <span class="status"><strong>Assigned To: </strong>
                <%#Eval("CapAssignedToFullname")%></span>
            <div class="noHighlightTable">
            usercode:<%#Eval("CapAssignedToUserCode")%>
                <%
                    if (showCompleteBtn || commonCap.SameUserCode(Eval("CapAssignedToUserCode").ToString(), currentUserCode))
                  {%>
                <a class="noHighlightBtn" onclick="OpenSPDialog('/_layouts/beim/CAPAction.aspx?capDataId=' + <%#Eval("CapDataId")%>, 'Complete Action')"
                    href="javascript:void(0);">Complete action</a>
                   <%
                  }%>
  • 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-25T05:51:24+00:00Added an answer on May 25, 2026 at 5:51 am

    Call a method inline. The method has your logic/output.

    <%# WhateverYourLogicIs( (bool) DataBinder.Eval(Container.DataItem,"CapAssignedToUserCode") ) %>
    

    There are several other ways including checking the eval directly.
    Check out:

    Conditional Logic in ASP.net page

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

Sidebar

Related Questions

I have an VS2005 ASP.Net page with a repeater on it of Customers. The
I have a asp.net repeater control in a aspx page, with runat=server and an
I have an ASP.NET page and I am generating an HTML table in my
I have a ASP.NET 3.5 page which has a repeater containing lines of information
I have an ASP.net repeater on my page which creates a load of listitems.
I have a DropDownList inside a repeater control in an ASP.NET page that has
I have a designed landing page in asp.net 4.0 i am using repeater control
I have an ASP.NET page that uses a repeater nested within another repeater to
I have asp.net repeater on a page. If each item being repeated is wrapped
I have a page on my ASP.NET site that has a Repeater control to

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.