Export (0) Print
Expand All

WebPageBase.RenderSection Method (String)

In layout pages, renders the content of a named section.

Namespace:  System.Web.WebPages
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

public HelperResult RenderSection(
	string name
)

Parameters

name
Type: System.String
The section to render.

Return Value

Type: System.Web.WebPages.HelperResult
The HTML content to render.

ExceptionCondition
HttpException

The name section was already rendered.

-or-

The name section was marked as required but was not found.

The RenderSection method assumes that a section passed to it in the name parameter actually exists. If the named section does not exist, the method throws an exception. If you want to use an optional section where the section might exist in an instance of a content page, use the RenderSection method overload to render the section.

Show:
© 2014 Microsoft