WebPage Class

Represents an ASP.NET Razor page.

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

public abstract class WebPage : WebPageBase

The WebPage type exposes the following members.

  NameDescription
Protected methodWebPageCalled from a derived class to create a new instance that is based on the WebPage class.
Top

  NameDescription
Public propertyAppGets the application-state data as a DynamicObject object that callers can use to create and access custom application-scoped properties. (Inherited from WebPageExecutingBase.)
Public propertyAppStateGets a reference to global application-state data that can be shared across sessions and requests in an ASP.NET application. (Inherited from WebPageExecutingBase.)
Public propertyCacheWhen overridden in a derived class, gets the cache object for the current application domain. (Inherited from WebPageRenderingBase.)
Public propertyContextGets or sets the HttpContextBase object that is associated with a page. (Overrides WebPageExecutingBase.Context.)
Public propertyCultureWhen overridden in a derived class, gets or sets the culture for the current thread. (Inherited from WebPageRenderingBase.)
Public propertyHtmlGets the HtmlHelper object that is associated with a page.
Public propertyIsAjaxWhen overridden in a derived class, get a value that indicates whether Ajax is being used during the request of the web page. (Inherited from WebPageRenderingBase.)
Public propertyIsPostWhen overridden in a derived class, returns a value that indicates whether the HTTP data transfer method used by the client to request the web page is a POST request. (Inherited from WebPageRenderingBase.)
Public propertyLayoutGets or sets the path of a layout page. (Inherited from WebPageBase.)
Public propertyModelGets the model that is associated with a page.
Public propertyModelStateGets the state of the model that is associated with a page.
Public propertyOutputGets the current TextWriter object for the page. (Inherited from WebPageBase.)
Public propertyOutputStackGets the stack of TextWriter objects for the current page context. (Inherited from WebPageBase.)
Public propertyPageProvides property-like access to page data that is shared between pages, layout pages, and partial pages. (Inherited from WebPageBase.)
Public propertyPageContextWhen overridden in a derived class, gets the HTTP context for the web page. (Inherited from WebPageRenderingBase.)
Public propertyPageDataProvides array-like access to page data that is shared between pages, layout pages, and partial pages. (Inherited from WebPageBase.)
Public propertyRequestWhen overridden in a derived class, gets the HttpRequest object for the current HTTP request. (Inherited from WebPageRenderingBase.)
Public propertyResponseWhen overridden in a derived class, gets the HttpResponse object for the current HTTP response. (Inherited from WebPageRenderingBase.)
Public propertyServerWhen overridden in a derived class, gets the HttpServerUtility object that provides methods that can be used as part of web-page processing. (Inherited from WebPageRenderingBase.)
Public propertySessionWhen overridden in a derived class, gets the HttpSessionState object for the current HTTP request. (Inherited from WebPageRenderingBase.)
Public propertyTemplateInfoWhen overridden in a derived class, gets information about the currently executing file. (Inherited from WebPageRenderingBase.)
Public propertyUICultureWhen overridden in a derived class, gets or sets the current culture used by the Resource Manager to look up culture-specific resources at run time. (Inherited from WebPageRenderingBase.)
Public propertyUrlDataWhen overridden in a derived class, gets data related to the URL path. (Inherited from WebPageRenderingBase.)
Public propertyUserWhen overridden in a derived class, gets a user value based on the HTTP context. (Inherited from WebPageRenderingBase.)
Public propertyVirtualPathGets or sets the virtual path of the page. (Inherited from WebPageExecutingBase.)
Top

  NameDescription
Protected methodConfigurePageWhen overridden in a derived class, configures the current web page based on the configuration of the parent web page. (Inherited from WebPageBase.)
Public methodDefineSectionCalled by content pages to create named content sections. (Inherited from WebPageBase.)
Public methodEquals (Inherited from Object.)
Public methodExecuteExecutes the server code in the current web page that is marked using Razor syntax. (Inherited from WebPageExecutingBase.)
Public methodExecutePageHierarchy()Executes the code in a set of dependent pages. (Overrides WebPageBase.ExecutePageHierarchy().)
Public methodExecutePageHierarchy(WebPageContext, TextWriter)Executes the code in a set of dependent web pages by using the specified parameters. (Inherited from WebPageBase.)
Public methodExecutePageHierarchy(WebPageContext, TextWriter, WebPageRenderingBase)Executes the code in a set of dependent web pages by using the specified context, writer, and start page. (Inherited from WebPageBase.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodHrefWhen overridden in a derived class, builds a URL using the specified parameters. (Inherited from WebPageRenderingBase.)
Protected methodInitializePageInitializes an object that inherits from the WebPage class. (Overrides WebPageBase.InitializePage().)
Public methodIsSectionDefinedReturns a value that indicates whether the specified section is defined in the page. (Inherited from WebPageBase.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodNormalizePathReturns a normalized path from the specified path. (Inherited from WebPageExecutingBase.)
Public methodPopContextReturns and removes the context from the top of the OutputStack instance. (Inherited from WebPageBase.)
Public methodPushContextInserts the specified context at the top of the OutputStack instance. (Inherited from WebPageBase.)
Public methodStatic memberRegisterPageExecutorAdds a class to a list of classes that handle page execution and that implement custom features for pages.
Public methodRenderBodyIn layout pages, renders the portion of a content page that is not within a named section. (Inherited from WebPageBase.)
Public methodRenderPageRenders the content of one page within another page. (Inherited from WebPageBase.)
Public methodRenderSection(String)In layout pages, renders the content of a named section. (Inherited from WebPageBase.)
Public methodRenderSection(String, Boolean)In layout pages, renders the content of a named section and specifies whether the section is required. (Inherited from WebPageBase.)
Public methodToString (Inherited from Object.)
Public methodWrite(Object)Writes the specified object as an HTML-encoded string. (Inherited from WebPageBase.)
Public methodWrite(HelperResult)Writes the specified HelperResult object as an HTML-encoded string. (Inherited from WebPageBase.)
Public methodWriteLiteralWrites the specified object without HTML-encoding it first. (Inherited from WebPageBase.)
Top

The WebPage class is associated with source code files that have a .cshtml extension (for pages that use C#) or a .vbhtml extension (for pages that use Visual Basic). At run time, a web server compiles these files as WebPage objects and caches them in memory.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: