I have a controller located in Controllers folder.
Controllers
.... CustomViewController
The CustomViewController executes the following method
public ActionResult DisplayPerson()
{
Person prn = new Person();
prn.Name = "Rama";
prn.Email = "Jass@yahoo.com";
return View(prn);
}
I have two views located in CustomView folder
Views
....CustomView
.. DisplayPerson
.. PersonView2
Routing
routes.MapRoute(
"Display",
"{Controller}/{action}/{id}",
new { controller = "CustomView",
action = "DisplayPerson", id = "" }
);
Question :
By default the view "DisplayPerson" is used to display the Person details.What is the way to call the view "PersonView2" inside the "DisplayPerson()" method.
return View("DisplayPerson", prn)
or
return View("PersonView2", prn)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.