WebPageBase.RenderSection Method (String, Boolean)
In layout pages, renders the content of a named section and specifies whether the section is required.
Assembly: System.Web.WebPages (in System.Web.WebPages.dll)
'Declaration Public Function RenderSection ( _ name As String, _ required As Boolean _ ) As HelperResult 'Usage Dim instance As WebPageBase Dim name As String Dim required As Boolean Dim returnValue As HelperResult returnValue = instance.RenderSection(name, _ required)
Parameters
- name
- Type: System.String
The section to render.
- required
- Type: System.Boolean
true to specify that the section is required; otherwise, false.
Use the RenderSection method overload when you want to render optional content sections in a layout page. For example, if a user of your website lives in a certain region, the code on a content page could add a section that displays special pricing packages for that region. To specify that a section is optional and should only be rendered if it exists, pass false to the required parameter.
Show: