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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:45:19+00:00 2026-06-12T12:45:19+00:00

I have a ViewModel in: RolesMVC3.Area.Asesor.Models.ListNotesViewModel is the following: public class ListNotesViewModel { public

  • 0

I have a ViewModel in: RolesMVC3.Area.Asesor.Models.ListNotesViewModel

is the following:

public class ListNotesViewModel
    {
           public decimal IdTime { get; set; }

           public decimal IdArea { get; set; }

           public decimal IdCriterion { get; set; }

           public decimal Notes { get; set; }

           public decimal IdEstudent { get; set; }
    }

I have a controller that uses this ViewModel.

is the following:

public ActionResult EstudentsQualification()
   {

    var newItems = (from n in db.Qualification
                    join a in db.AREA on n.IdArea equals a.IdArea
                    join e in db.ESTUDENT on n.IdEstudent equals e.IdEstudent
                    join p in db.TIME on n.IdTime equals p.IdTime
                    join c in db.CRITERION on n.IdCriterion equals c.IdCriterion
                    where n.IdArea == 1 
                    select new ListNotesViewModel { IdCriterion = c.IdCriterion, IdTime = p.IdTime, Notes=n.Note, IdEstudent==e.IdEstudent }).ToList();



     var estu = (from n in db.Qualification
                 join e in db.ESTUDENT on n.IdEstudent equals e.IdEstudent
                 where n.IdArea == 1
                 select e).Distinct().ToList();

     ViewBag.Estudents = estu;
     ViewBag.Time = db.TIME;
     ViewBag.Criterion = db.CRITERION;
     ViewBag.Notes = newItems;

     return View();
 }

the associated view is:

@{
    ViewBag.Title = "Index";
}

<table border="1">

@foreach (var item4 in ViewBag.Estudents)
{
    <tr>
        <td>
             @item4.CodEstudents - @item4.NameEstudents 
        </td>
         @foreach (var item2 in ViewBag.Time)
         {
             foreach (var item3 in ViewBag.Criterion)
             {
                <td>

                 @if (ViewBag.Notes.IdCriterion == item3.IdCriterion && ViewBag.Notes.IdTime == item2.IdTime && ViewBag.Notes.IdEstudent == item4.IdEstudent)
                 {
                     @ViewBag.Notes.Note 
                 }
                 else
                 {
                     @:nothing
                 }    
               </td>                                                                                                                                                                       

             }
         }

    </tr>
}

</table>

I get the following error:

'System.Collections.Generic.List<RolesMVC3.Area.Asesor.Models.ListNotesViewModel>' does not contain a definition for 'IdCriterion'

I can’t figure out what 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-12T12:45:21+00:00Added an answer on June 12, 2026 at 12:45 pm

    Think this line caused it ViewBag.Notes.IdCriterion

    @if (ViewBag.Notes.IdCriterion == item3.IdCriterion && ViewBag.Notes.IdTime == item2.IdTime && ViewBag.Notes.IdEstudent == item4.IdEstudent)
    

    ViewBag.Notes is a collection of Note. You need to access item in Notes e.g. ViewBag.Notes[0].IdCriterion or ViewBag.Notes[i].IdCriterion or foreach(noteItem in ViewBag.Notes)

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

Sidebar

Related Questions

I have following ViewModel: public class Bulletin1ViewModel { [Required] public String NumberDelegations { get;
Suppose I have ViewModel like public class AnotherViewModel { public string Name { get;
I have a viewmodel defined as public class linkVM { public AL.Common.Content.Object.PageIndex[] pages{ get;
I have following ViewModel containing NumberOfAdults fields. public class SearchView { public int NumberOfAdults
I have viewmodel which i am contructing in a Create get action, public class
I have a viewmodel as such: namespace Lipton.Areas.Drugs.Models { public class DrugViewModel { public
We have a ViewModel with a collection of Widget<dynamic> : public class Widget<T> {
I have this ViewModel public class CustomerSuscribeViewModel : IValidatableObject { [DataMember(IsRequired = true)] [DataType(DataType.Text)]
I have a ViewModel class to encapsulate Personal and Business models. My problem is
I have a ViewModel class FontsViewModel : ObservableObject { public FontsViewModel() { InitFonts(); }

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.