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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:45:15+00:00 2026-06-15T21:45:15+00:00

I have a controller that returns an ActionResult. Specifically, it calls return View(someViewModel) at

  • 0

I have a controller that returns an ActionResult. Specifically, it calls return View(someViewModel) at the end of the method. Here’s the method signature:

protected ActionResult SomeControllerMethod(AViewModel someViewModel)

I’ve subsequently inherited from AViewModel (AnInheritedViewModel), added a few new properties to the class and am now passing it into SomeControllerMethod.

Now, at the return statement at end of this method I get an error about how the view can’t be found. That’s fair enough, but I’m not sure how this all works by default.

The view names MVC tells me it’s looking for don’t line up with the name of either the controller method or the model type. Going by the same pattern, there are no views corresponding to the name of the original model either. So I’m not sure how MVC decides which view it’s going to use?

  • 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-15T21:45:16+00:00Added an answer on June 15, 2026 at 9:45 pm

    When you

    public ActionResult SomeControllerMethod()
    {
        return View();
    }
    

    MVC tries to look for a view named “SomeControllerMethod.cshtml”. It uses the name of the method as a guide for looking for a view file.

    You can override this by:

    public ActionResult SomeControllerMethod()
    {
        return View("MyView");
    }
    

    and MVC will thus try to find “MyView.cshtml”.

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

Sidebar

Related Questions

If I create an controller method that returns ActionResult, then call View() at the
I have a controller method that returns a jSON object and in one calling
If i have a controller action Create that returns a view with the following
I have the following getJSON that calls an MVC controller which returns inforamtion back:
I have a really simple action in a controller that simply returns a view
I have an MVC controller that has this Action Method: [HttpPost] public ActionResult SubmitAction()
I have a method... [HttpPost] public ActionResult Start(SomeViewModel someViewModel) { ... } that based
I have a controller ActionResult that returns JSON that I would like to cache.
I have this controller function that returns cpu stats: public ActionResult GetStats() { Random
In ASP.Net MVC if I have a method on a controller that returns a

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.