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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:06:49+00:00 2026-05-27T21:06:49+00:00

I have an issue with a particular controller action not displaying the view. Here

  • 0

I have an issue with a particular controller action not displaying the view.

Here is the Controller Action:

public ActionResult DisplayStudents(string id)
        {
            var name = (from p in data.StudentTable.Where(a => a.ClassNumberID == id)
                                  group n by n.StudentName into g
                                  select g.Key).First();

            return View(name);
        }

Controller Name is “Student” and the view is present in “Views/Student/DisplayStudents.aspx”

Why do I still get this error:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The view 'Thomas Guenn' or its master was not found. The following locations were searched:
~/Views/Student/Thomas Guenn.aspx
~/Views/Student/Thomas Guenn.ascx
~/Views/Shared/Thomas Guenn.aspx
~/Views/Shared/Thomas Guenn.ascx 

Also, why is it looking for “Thomas Guenn.aspx” instead of “DisplayStudents.aspx” ?

Here is my View page:

>” %>

DisplayStudents

Students are listed below:

<table>

<% foreach (var item in Model) { %>
     <tr>
        <td>
            <%= Html.Encode(item)%>
        </td>
    </tr>

<% } %>

</table> </body> </html>
  • 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-27T21:06:49+00:00Added an answer on May 27, 2026 at 9:06 pm

    Because your View(name); call is calling overload View(string viewName). If you want to pass string as Model then try using

    return View((object)name);
    

    instead.

    If this doesn’t work, try to specify viewName explicitly, using overload View(string viewName, object model) like this:

    return View("DisplayStudents", name);
    

    UPD: Looking at your view code, I can say that it won’t return expected page either: you’re returning a single string item as a model from controller, but your DisplayStudents.aspx expects a collection. You should also either correct your view (so it will accept single string as model) or return an IEnumerable<string> from controller – by removing .First() from LINQ expression for name.

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

Sidebar

Related Questions

I have forms posting data from instances of a particular abstract class: public abstract
I have a issue where I'm working with a particular interface for quite a
I have a code first model: namespace InternetComicsDatabase.Models { public class Issue { [Key]
I have a issue here with unzipping the .zip files that i have in
I have a particular issue. The data inside of my HTML <input> elements is
Here's the issue... if I use, say a directory catalog in MEF and have
I have recently run into a particularly sticky issue regarding committing the result of
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So
I have an issue that is driving me a bit nuts: Using a UserProfileManager
We have an issue using the PEAR libraries on Windows from PHP . Pear

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.