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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:19:24+00:00 2026-06-14T17:19:24+00:00

VisualStudio2010 tells me that it’s the Model Property associated with System.Mvc.ViewDataDictionary Object which is

  • 0

VisualStudio2010 tells me that it’s the Model Property associated with System.Mvc.ViewDataDictionary Object which is helpful, but the docs for DataDictionary don’t seem to show me what I want, in an easily understood format, at least.

Note that the following .cshtml file is in BorkedModel‘s View folder, but the model I want to access is in ExampleModel‘s Model folder. This exact code would work if the file itself was in the ExampleModel‘s View folder, but not in a different model’s View folder.

ProjectTopDirectory/Views/BorkedModel/index.cshtml

@model IEnumerable<ExampleMVC4.Models.ExampleModel> 

    @foreach (var item in Model)
{
    <HTML here/>
}

Is there a solution to what I’m doing, or should I just keep models in their own view, and that’s it? Is there a way to access one Model from another Model’s View?

  • 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-14T17:19:25+00:00Added an answer on June 14, 2026 at 5:19 pm

    To use a strongly typed model in a view you need to pass the model to the view from the controller:

    public ActionResult Index()
    {
        YourDBContext db = new YourDBContext();
        IEnumerable<ExampleModel> model = db.GetDataFromDatabase();
        return View(model); // Pass the model to the view
    }
    

    Then in your view you specify the model, which should allow you to access the data:

    @model IEnumerable<NextFlicksMVC4.Models.ExampleModel>
    
    @foreach (var item in Model)
    {
        // Your HTML
    }
    

    UPDATE: Your controller action method should be retrieving the data from the database and then passing it to the View. The view’s only job is to display the data to the user.

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

Sidebar

Related Questions

In VisualStudio2010 Ultimate RC I cannot figure out how to suppress {CollectionAssert.AreEqual failed. (Element
I have a SOAP service that returns an array of a complex type. The
Hai, I done a server program in vc++(using visualstudio 2008). At that time it
i'm developing bluetooth app on VisualStudio2008 windows mobile 6 sdk.I searched that i will
I was advised a while ago that is was common place to use std::vector
I just installed Windowsazure SDK 1.5 and respective tools for Visualstudio 2010. But when
I'm using VisualStudio2010 SP1, ReSharper 6.1.1. and the ReSharper SDK 6.1.0.51. I ban build
I'm using the ReportViewer 10.0.0.0 from VisualStudio2010 into my Web Application and I'm having
Is it possible in a DirectX11 application in VisualStudio2010 while debugging to step through
I have a program for which I have developed a user guide. I have

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.