Implemented interface member:
property
ViewContext
Microsoft.AspNetCore.Mvc.Razor.IRazorPage.ViewContext
1 override of ViewContext
Microsoft.AspNetCore.Mvc.RazorPages (1)
PageBase.cs (1)
37public override ViewContext ViewContext { get; set; } = default!;
6 writes to ViewContext
Microsoft.AspNetCore.Mvc.Razor.Test (5)
RazorPageCreateModelExpressionTest.cs (3)
277ViewContext = viewContext, 287ViewContext = viewContext, 297ViewContext = viewContext,
RazorPageCreateTagHelperTest.cs (1)
105ViewContext = viewContext
RazorPageTest.cs (1)
1401view.Object.ViewContext = context;
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\RazorPageAdapter.cs (1)
35set { _page.ViewContext = value; }
39 references to ViewContext
Microsoft.AspNetCore.Mvc.Razor (21)
RazorPage.cs (2)
23public HttpContext Context => ViewContext?.HttpContext!; 174var viewContext = ViewContext;
RazorPageBase.cs (19)
62var viewContext = ViewContext; 65throw new InvalidOperationException(Resources.FormatViewContextMustBeSet(nameof(ViewContext), nameof(Output))); 82public dynamic ViewBag => ViewContext?.ViewBag!; 134public virtual ClaimsPrincipal User => ViewContext.HttpContext.User; 137/// Gets the <see cref="ITempDataDictionary"/> from the <see cref="ViewContext"/>. 139/// <remarks>Returns null if <see cref="ViewContext"/> is null.</remarks> 140public ITempDataDictionary TempData => ViewContext?.TempData!; 150var services = ViewContext.HttpContext.RequestServices; 164var services = ViewContext.HttpContext.RequestServices; 204return TagHelperFactory.CreateTagHelper<TTagHelper>(ViewContext); 220var viewContext = ViewContext; 254ViewContext.Writer = scopeInfo.Writer; 276var viewContext = ViewContext; 310ViewContext.Writer = _pageWriter; 325var viewContext = ViewContext; 337var viewContext = ViewContext; 354var viewContext = ViewContext; 701await ViewContext.HttpContext.Response.Body.FlushAsync(); 713var viewContext = ViewContext;
Microsoft.AspNetCore.Mvc.Razor.Test (17)
RazorPageCreateModelExpressionTest.cs (1)
365return ModelExpressionProvider.CreateModelExpression(ViewData, m => ViewContext.ViewData.Model);
RazorPageTest.cs (8)
41v.ViewContext.Writer.Write("Hello from view context writer"); 1275Assert.Same(writer, page.ViewContext.Writer); 1284page.ViewContext.Writer = defaultWriter; 1292Assert.Same(writer, page.ViewContext.Writer); 1299Assert.Same(defaultWriter, page.ViewContext.Writer); 1308page.ViewContext.Writer = defaultWriter; 1323page.ViewContext.Writer = defaultWriter; 1366page.ViewContext.Writer = writer;
RazorViewTest.cs (8)
65Assert.Same(viewData, v.ViewContext.ViewData); 103Assert.Same(viewData, v.ViewContext.ViewData); 152paths.Add(v.ViewContext.ExecutingFilePath); 153Assert.Equal(pagePath, v.ViewContext.View.Path); 162paths.Add(v.ViewContext.ExecutingFilePath); 163Assert.Equal(pagePath, v.ViewContext.View.Path); 172paths.Add(v.ViewContext.ExecutingFilePath); 173Assert.Equal(pagePath, v.ViewContext.View.Path);
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\RazorPageAdapter.cs (1)
34get { return _page.ViewContext; }