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

  • Home
  • SEARCH
  • 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 905581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:14:42+00:00 2026-05-15T16:14:42+00:00

I have a asp.net mvc view which is strongly typed view and i have

  • 0

I have a asp.net mvc view which is strongly typed view and i have a controller which returns
the ilist user based on the id provided. I am getting the following above error:

The model item passed into the dictionary is of type ‘System.Collections.Generic.List`1[Data.User]’, but this dictionary requires a model item of type ‘Data.User’.

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Data.User>" %>
<% using (Html.BeginForm()) 
{%> <%= Html.ValidationSummary(true) %>            
<fieldset> 

 <legend>Fields</legend>                
                <div class="editor-label">
                    <%= Html.LabelFor(model => model.Id) %>
                </div>
                <div class="editor-field">
                    <%= Html.TextBoxFor(model => model.Id) %>
                    <%= Html.ValidationMessageFor(model => model.Id) %>
                </div>                
                <div class="editor-label">
                    <%= Html.LabelFor(model => model.UserName) %>
                </div>
                <div class="editor-field">
                    <%= Html.TextBoxFor(model => model.UserName) %>
                    <%= Html.ValidationMessageFor(model => model.UserName) %>
                </div>

                <div class="editor-label">
                    <%= Html.LabelFor(model => model.Email) %>
                </div>
                <div class="editor-field">
                    <%= Html.TextBoxFor(model => model.Email) %>
                    <%= Html.ValidationMessageFor(model => model.Email) %>     

     public ActionResult EditUser(int id)
            {

                    var usr = _UsrService.GerUserById(id).ToList<User>();                
                    return View(usr);
            }
  • 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-05-15T16:14:43+00:00Added an answer on May 15, 2026 at 4:14 pm

    You can’t pass a List to a modal that is to display a single item.

    Try removing the .ToList<User> so that it looks something like

    Data.User usr = _UsrService.GetUserById(id).FirstOrDefault;
    return View(usr)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a strongly typed asp.net-mvc view and the Model has a . Links
I have ASP.NET MVC controller named dictionary with method ControlsLangJsFile. Method returns view of
I have existing ASP.NET MVC View pages and View user controls which I currently
I have an ASP.NET MVC view which contains checkboxes for user-defined categories. <td><% foreach
I have an ASP.NET MVC view on which I've placed jQuery tabs. I'm loading
I am using ASP.Net MVC. I have a partial view which has a form
In ASP.NET MVC there is Model, View and Controller. MODEL represents entities which are
I have a simple ASP.Net MVC View which contains an FCKeditor text box (created
I have a ASP.NET MVC 3 view with esentially two forms, but which reside
I am new in asp.net mvc and learning. I have a view which pass

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.