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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:49:08+00:00 2026-06-15T12:49:08+00:00

I have an Approval class, which has a list of ApprovalDocument objects. The Approvals

  • 0

I have an Approval class, which has a list of ApprovalDocument objects.
The Approvals class has an ActiveApprovalDocument property.

My model has a list of Approvals.

I want too show a property of the active approval document:

<%= Html.DisplayFor(m => m.Approvals[i].ApprovalDocuments[m.Approvals[i].ActiveApprovalDocumentsId.Value].CertificationIssuedDate)%>

I realise I could just directly display Model.Approvals[i].... but how can I still use the DisplayFor (so I get the automatic formatting etc.)?


The error I get is:

System.InvalidOperationException: The expression compiler was unable to evaluate the indexer expression ‘m.Approvals.get_Item(value(ASP.areas_approvals_views_approvals_index_aspx+<>c__DisplayClass0).i).ActiveApprovalDocumentsId.Value’ because it references the model parameter ‘m’ which is unavailable. —> System.InvalidOperationException: Lambda Parameter not in scope

  • 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-15T12:49:09+00:00Added an answer on June 15, 2026 at 12:49 pm
    <% var j = Model.Approvals[i].ActiveApprovalDocumentsId.Value; %>
    <%= Html.DisplayFor(m => m.Approvals[i].ApprovalDocuments[j].CertificationIssuedDate) %>
    

    Or just use a view model.

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

Sidebar

Related Questions

I have a custom content type in SharePoint which has an approval workflow associated
I have a class named InvoiceLine which has the following properties. public class InvoiceLine
I have a class ApprovalTicket that has a property called ApprovalRules that is of
I have an action 'approval' that renders a view which displays some content from
I have a SharePoint list with Content Approval enabled. The business requirement is that
have written this little class, which generates a UUID every time an object of
I have recommendations has_many approvals Basically a recommendation gets created with an approval. The
I have a trigger which initiates an approval process when certain criteria are met:
I'm creating a user approval interface leveraging the .Net Membership class. I have a
Say I have two models in my Django project. class Project(models.Model): name = models.CharField(max_length=256)

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.