There are several 1 dynamic content views in the view. Inline Code2. Html Helper3. Section4.partial View 4.Child Action
Section
The Razor view engine supports separating part of the view so that it can be reused where it is needed, reducing the redundancy of the Code
section can only be in the current view or its LA
Called in the yout. @RenderSection method does not find the section specified by the parameter throws an exception
Partial View
Partial view is the partial Razor and Html tags that are placed in a separate view file for reuse in different places.
Create a new view file named Mypartial in the/views/shared directory, and tick "make as partial view"
There is no difference between Partial view and normal and view usage, or you can use strong typing, such as the type of model that we specify in mypartial.cshtml by @model:
Child Action
The child action is similar to Patial view and can be reused for the same sub-content in different parts of the application. The difference is that it renders the child content by invoking the action method in the controller, and typically contains the processing of the business
HtmlHelper extension methods
Table cell Helper Method
Take advantage of its HTML. BeginForm () and HTML. EndForm () constructs a simple form
@Html. BeginForm () <label>userName</label> <input name=
"
username
" type=
"
text
"/> <label>password</label> <input name=
"
password
" Type=
"
text
" / > <input type=
"
submit
" value=
"
submit " Span style= "COLOR: #800000" > "/>
@{html.endform ();}
Another way of writing
@Html. BeginForm () { <label>userName</label> <input name= " username " type= " text "/> <label>password</label> <input name=" password " Type= " text " / > <input type= " submit " value= " submit " Span style= "COLOR: #800000" > "/>}
ASP. NET MVC Learning view dynamic content and HtmlHelper