System.Web.WebPages.WebPageBase.RenderSurrounding C# (CSharp) Method

RenderSurrounding() private method

private RenderSurrounding ( string partialViewName, Action body ) : void
partialViewName string
body Action
return void
        private void RenderSurrounding(string partialViewName, Action<TextWriter> body)
        {
            // Save the previous body action and set ours instead.
            // This value will be retrieved by the sub-page being rendered when it runs
            // Render(ViewData, TextWriter).
            var priorValue = PageContext.BodyAction;
            PageContext.BodyAction = body;

            // Render the layout file
            Write(RenderPageCore(partialViewName, isLayoutPage: true, data: new object[0]));

            // Restore the state
            PageContext.BodyAction = priorValue;
        }