return View () related introduction
When you return to view in ASP. Viewresult, it inherits from Viewresultbase and it has a brother Partialviewresult. One to return the whole, and the other to return the local (HTML)
Use the relevant
1, controller writing: Except for the last change to "return Partialview ()" The remaining no difference
2, depending on the book write: @Html. Partial () has four overloads. Choose according to the situation
@Html. Partial ("Customerlistcontrol") when you write this, query all files named "Customerlistcontrol", take the first (in ascending alphabetical order) nesting
@Html. Partial ("Customerlistcontrol"); @* Fuzzy Query the specified file within the Web, with the same name in ascending order by suffix *@
@Html. Partial ("/views/home/viewusercontrol.ascx"); @* Specifying path/File *@
@Html. Partial ("Customerlistcontrol", @Model);
@Html. Partial ("Customerlistcontrol", viewdatadictionary); @*viewdatadictionary ViewData dictionary *@
@Html. Partial ("Customerlistcontrol", @Model, viewdatadictionary);
Using html.partial nested pages under ASP. NET MVC (functionally equivalent user control)