views:

41

answers:

1

I auto-generated a controller, and it includes calls such as:

//
// GET: /User/

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

//
// GET: /User/Create

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

What determines the actual view (.aspx file) that these parameterless View() calls invoke?

+7  A: 

The framework uses convention based on the action name, in you example it will look for a view called Index or Create. It looks first under the View folder in a subfolder based on the controller name (so for e.g. a controller called ProductsController will look under the products subfolder of the views folder) if one is not found there it will look under the shared subfloder in the views folder.

hope this helps

Pharabus