Пример #1
0
        /// <inheritdoc />
        public virtual async Task RenderAsync([NotNull] ViewContext context)
        {
            _pageExecutionFeature = context.HttpContext.GetFeature<IPageExecutionListenerFeature>();

            // Partials don't execute _ViewStart pages, but may execute Layout pages if the Layout property
            // is explicitly specified in the page.
            var bodyWriter = await RenderPageAsync(RazorPage, context, executeViewStart: !IsPartial);
            await RenderLayoutAsync(context, bodyWriter);
        }
Пример #2
0
        /// <inheritdoc />
        public virtual async Task RenderAsync([NotNull] ViewContext context)
        {
            _pageExecutionFeature = context.HttpContext.GetFeature <IPageExecutionListenerFeature>();

            // Partials don't execute _ViewStart pages, but may execute Layout pages if the Layout property
            // is explicitly specified in the page.
            var bodyWriter = await RenderPageAsync(RazorPage, context, executeViewStart : !IsPartial);

            await RenderLayoutAsync(context, bodyWriter);
        }
Пример #3
0
        /// <inheritdoc />
        public virtual async Task RenderAsync(ViewContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _pageExecutionFeature = context.HttpContext.Features.Get<IPageExecutionListenerFeature>();

            // Partials don't execute _ViewStart pages, but may execute Layout pages if the Layout property
            // is explicitly specified in the page.
            var bodyWriter = await RenderPageAsync(RazorPage, context, executeViewStart: !IsPartial);
            await RenderLayoutAsync(context, bodyWriter);
        }
Пример #4
0
        /// <inheritdoc />
        public virtual async Task RenderAsync([NotNull] ViewContext context)
        {
            _pageExecutionFeature = context.HttpContext.GetFeature <IPageExecutionListenerFeature>();

            if (IsPartial)
            {
                await RenderPartialAsync(context);
            }
            else
            {
                var bodyWriter = await RenderPageAsync(RazorPage, context, executeViewStart : true);
                await RenderLayoutAsync(context, bodyWriter);
            }
        }
Пример #5
0
        /// <inheritdoc />
        public virtual async Task RenderAsync(ViewContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            _pageExecutionFeature = context.HttpContext.Features.Get <IPageExecutionListenerFeature>();

            // Partials don't execute _ViewStart pages, but may execute Layout pages if the Layout property
            // is explicitly specified in the page.
            var bodyWriter = await RenderPageAsync(RazorPage, context, executeViewStart : !IsPartial);

            await RenderLayoutAsync(context, bodyWriter);
        }
Пример #6
0
        /// <inheritdoc />
        public virtual async Task RenderAsync([NotNull] ViewContext context)
        {
            if (_razorPage == null)
            {
                var message = Resources.FormatViewMustBeContextualized(nameof(Contextualize), nameof(RenderAsync));
                throw new InvalidOperationException(message);
            }

            _pageExecutionFeature = context.HttpContext.GetFeature<IPageExecutionListenerFeature>();

            if (_isPartial)
            {
                await RenderPartialAsync(context);
            }
            else
            {
                var bodyWriter = await RenderPageAsync(_razorPage, context, executeViewStart: true);
                await RenderLayoutAsync(context, bodyWriter);
            }
        }