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

The Archive Base Latest Questions

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

Very simple MVC application, with one model, one loosely typed view and controller sending

  • 0

Very simple MVC application, with one model, one loosely typed view and controller sending
List<Model> to the view through ViewBag.

All was working fine until I updated the model. Now I get ‘Model’ does not contain a definition for ‘PropertyName’, Tried rebuilding the application and cleaning the temp folder.

What do I need to clean up to get this recompiled properly?

~Edit: Property that cannot be found was added to the Model not removed. And I’m trying to use this new property in the View.

~Edit:
Model:

public class App
{
    public String title { get; set; }
    public String featured { get; set; }
    public String subtitle { get; set; }
    public String thumb { get; set; }
    public String logo { get; set; }
    public String web { get; set; }
    public String email { get; set; }
    public String phone { get; set; }
    public String download { get; set; }
    public String body { get; set; }
    public List<String> tags { get; set; }
    public List<String> features { get; set; }
    public List<Highlight> highlights { get; set; }
}

Controller:

ViewBag.apps = (from xml in XmlResources.Root.Descendants("app")
                        select new App
                        {
                            title = xml.Element("title").Value,
                            featured = xml.Attribute("featured").Value,
                            subtitle = xml.Element("subtile").Value,
                            thumb = xml.Element("thumb").Value,
                            logo = xml.Element("logo").Value,
                            web = xml.Element("web").Value,
                            email = xml.Element("email").Value,
                            phone = xml.Element("phone").Value,
                            download = xml.Element("download").Value,
                            body = xml.Element("body").Value,
                            tags = (from x in xml.Descendants("tag") select x.Value).ToList(),
                            features = (from x in xml.Descendants("feature") select x.Value).ToList(),
                            highlights = (from x in xml.Descendants("highlight") select new Highlight { type = x.Attribute("type").Value, src = x.Attribute("src").Value }).ToList()
                        }).ToList();

View:

@using eduApps.Models;
 @for (var i = 0; i < ViewBag.apps.Count; i++)
 {
  @{ if(!String.IsNullOrEmpty(ViewBag.apps[i].web))
                   {
                        <span>Web:</span><a href="@ViewBag.apps[i].web" title="@ViewBag.apps[i].title">@ViewBag.apps[i].web</a>
                    }
  }
}

Error:
‘eduApps.Models.App’ does not contain a definition for ‘web’

  • 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-15T10:52:51+00:00Added an answer on June 15, 2026 at 10:52 am

    Try casting to your class (ViewBag.apps[i] as eduApps.Models.App) when using it, as there is no strong typing here MVC will see your ViewBag.apps[i] simply as an object and not an App which indeed won’t contain any of your defined properties:

    @{ 
        if(!String.IsNullOrEmpty((ViewBag.apps[i] as App).web))
        {
            <span>Web:</span><a href="@(ViewBag.apps[i] as App).web" title="@(ViewBag.apps[i] as App).title">@(ViewBag.apps[i] as App).web</a>
        }
    }
    

    I don’t know where your App class definition is located so you’ll have to replace Namespace. with the appropriate name space, or add a using directive to your name space at the top of your view.

    EDIT – sorry just noticed you’ve already added a using to your view of eduApps.Models. I’ve amended my answer.

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

Sidebar

Related Questions

I've got a very simple question around Rails MVC/application design with a focus on
I am currently building a very small/simple web application in ASP.NET MVC with ADO.NET
I've written a very simple MVC FW, so all requests are routed to index
I want to create a simple mvc application. It's typical task and very simular
I'm developing a web application using a very simple (maybe not really MVC-compliant) MVC
I'm writing a very simple web application in ASP.NET MVC 2.0 which is used
I am tryying to implement a very simple Spring MVC application however not interested
I have written a VERY simple MVC application which just displays a single string
I have a very simple MVC site that is returning a 404 not found
I'm trying to get a very simple Spring @mvc app to work and I'm

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.