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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:15:00+00:00 2026-05-23T19:15:00+00:00

I’ve added 3 controllers, and for one of them the Index view doesn’t work

  • 0

I’ve added 3 controllers, and for one of them the Index view doesn’t work by default.

Works(shows index):
http://localhost:1767/Employees/  
http://localhost:1767/Employees/Index
http://localhost:1767/Home/       
http://localhost:1767/Home/Index
http://localhost:1767/
http://localhost:1767/Companies/Index

Doesn't work(gives 404 error):
http://localhost:1767/Companies/  

1) I created an entity framework class library, generated from a database containing a Employees and Companies table.

2) Created a MVC 3 empty project.

3)Added a project reference from the MVC project to the EF class library project.

4)Added a controller, and in the add controller dialog I chose the EF model and one of the tables and named the controller CompaniesController

5)Then I remembered I needed a HomeController, so I added another controller, naming it HomeController, and again chose the Companies entity.

6)Finally I added a EmployeesController choosing the Employees entity.

This is the only route in my Global.asax.cs:

routes.MapRoute(
          "Default", // Route name
          "{controller}/{action}/{id}", // URL with parameters
          new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults

Why doesn’t the http://localhost:1767/Companies/ URL default to the index action like all of the other controllers? I have done a few practice MVC projects and seem to always have this problem. The Employees controller defaulting to Index works fine, even though there is no route that tells it to do this?

Edit: Here is the error I receive:

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Companies/

Edit: So I usually don’t reveal the names of my entities or domain details when posting examples online, but in this case Companies was really called Properties, and changing the name to Properties2 for the view folder and controller fixed the issue. So it seems Properties is a special keyword that breaks the default to Index if it appears in a URL

  • 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-23T19:15:02+00:00Added an answer on May 23, 2026 at 7:15 pm

    Changed the view folder and controller from Properties(Controller) to Properties2(Controller) and it works fine now. Apperently “Properties” has some special handling in a URL and breaks the defaulting to index

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

Sidebar

Related Questions

I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.