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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:12:18+00:00 2026-06-03T06:12:18+00:00

I created a sample MVC application using following Template. ASP.NET MVC2 Empty Web Application

  • 0

I created a sample MVC application using following Template.

ASP.NET MVC2 Empty Web Application

Then a added a Controller with the name of First and a right clicked the ActionResult to add a View.

I typed http://localhost:49565/First in my Browser.

Query

How is the controller internally getting to know that a specific page will be displayed when we will type http://localhost:49565/First ?

Moreover, If I add multiple Views for a Controller. How will the system decide which one will be displayed on Priority ?

  • 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-03T06:12:19+00:00Added an answer on June 3, 2026 at 6:12 am

    The controller is invoked by the MVC framework, which uses the routes defined in Global.asax.cs to determine which controller and action to invoke. There is a default route that looks like this:

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

    When the application receives a request is will try to parse the URL to the format of the routes. If the request is made to http://localhost:49565/, it will use the default values which goes to the Index action in the controller named HomeController. When you have created the new controller, FirstController, and call http://localhost:49565/First, it uses the FirstController instead of the HomeController since it has been provided (but still to the Index action).

    Further, when an action is being invoked and there is no view defined explicitly, it will look for a view named the same as the invoked action. In your case it would be ~/Views/First/Index.aspx.

    EDIT

    If you want to use another view you can specify it in the return statement

    return View("OtherView");
    

    and it will use ~/Views/First/OtherView.aspx instead.

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

Sidebar

Related Questions

I have created a sample project using ASP.NET MVC 3 Web Application (Razor) template.
using VS 2008 i created a clean asp.net MVC application project and changed nothing
I have a web application which was using Asp.net MVC2 . I Upgraded it
Hi! i try to learn Asp.net MVC.i created a sample application to learn it.
I followed this tutorial to create a sample Login application using ASP.NET MVC I
Suppose I am creating a application using the sample Northwind database using asp.net mvc
I created a simple Asp.net MVC 4 application I created the NUnit test project
I created a simple ASP.NET MVC version 1.0 application. I have a ProductController which
I have opened a sample ASP.NET MVC project. In HomeController I have created a
I've been building my sample asp.net application using VWD2008 and the development virtual server

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.