C# MVC App error

Posted on 2011-10-17
Last Modified: 2012-05-12
I am new to C# using MVC. I have a simple program that should display a list of items from my database on a webpage. When I launch my web page I get the following error. Please see the files attached.

Server Error in '/' Application.
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[VTask.V_Site]', but this dictionary requires a model item of type 'VTask.Models.Sites'.

When I create the index view I used;

"Create a strongly-typed view".

View data class: VTask.Models.Sites

I can also see the following data class in the list.
Question by:wademi
    1 Comment
    LVL 3

    Accepted Solution

    You're trying to pass a List<VTask.Models.Sites> into a page that expects a VTask.Models.Sites
    Try changing the Index page to inherit from System.Web.Mvc.ViewPage<List<VTask.Models.Sites>> instead.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Article by: Najam
    Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
    This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now