System.Web.UI.Page

only for RuBoard

System.Web.UI.Page

The System.Web.UI.Page class provides server-side events and capabilities for a .aspx file. It includes properties ( specifically , Application , Context , Request , Response , Session , and Server ) to quickly access contextual information. Table A.1 lists the methods of the Page class, Table A.2 lists the available properties of the Page class, and Table A.4 lists the available events of the Page class.

Table A.1. Methods of the System.Web.UI.Page Class

Method Name

Description

DataBind

Binds a data source to the page and all its child controls.

DeterminePostBackMode

Determines if the page was the result of an HTTP POST or GET postback operation. If it was not a postback request, null is returned in C# ( Nothing in Visual Basic). If it was an HTTP POST postback, the Form collection information is returned. If it was an HTTP GET postback, the QueryString collection information is returned.

FindControl

Finds a specified server control.

GetPostBackClientEvent

Obtains a reference to a client-side script function that causes a server postback when invoked.

GetPostBackClientHyperlink

Appends JavaScript to the beginning of the return from a GetPostBackEventReference call to allow hyperlink postback processing on the server. Returns the name of the client-side function and the ID property of the server control that processed the function and argument passed to the control.

HasControls

Determines if the server control contains any child controls.

GetPostBackEventReference

Obtains a reference to a client-side script function that causes a server postback when invoked.

IsClientScriptBlockRegistered

Determines if a named client script block is already registered within the page.

IsStartupScriptRegistered

Determines if a named startup script block is already registered within the page.

LoadPageStateFromPersistenceMedium

Loads the view state information from the specified persistence medium. Stores view state in a medium other than hidden form variables .

MapPath

Retrieves the physical path for a virtual path .

ParseControl

Parses a string argument to create a System.Web.UI.Control object reference.

RaisePostBackEvent

Notifies the server control that caused the postback that it must handle an incoming postback event.

RegisterArrayDeclaration

Creates a client-side array declaration and populates it with the specified contents.

RegisterClientScriptBlock

Creates a client-side script block from server controls.

RegisterHiddenField

Registers a hidden form field from a server control.

RegisterOnSubmitStatement

Registers a client-side script (registered with RegisterClientScriptBlock ) to respond to a client OnSubmit event.

RegisterRequiresPostBack

Registers a control as requiring postback handling.

RegisterRequiresRaiseEvent

Registers a server control as requiring a page process event.

RegisterStartupScript

Registers a client-side script (previously registered with RegisterClientScriptBlock ) as a startup script.

RegisterViewStateHandler

Persists the page view state.

SavePageStateToPersistenceMedium

Saves the page view state to the specified object.

Validate

Instructs validation controls in the page to perform validation.

VerifyRenderingInServerForm

Confirms that a System.Web.UI.HtmlControls.HtmlForm control is rendered for the specified ASP.NET server control at run-time.

Table A.2. Properties of the System.Web.UI.Page Class

Property Name

Description

Application

Gets a reference to the HttpApplicationState (application intrinsic object) instance object for the current application.

Cache

Gets the System.Web.Caching.Cache object associated with the application to which the page belongs.

ClientTarget

Disables browser capabilities detection and uses the capabilities defined in web.config .

Context

Gets an HttpContext (context intrinsic control) instance object, allowing access to the context under which the web server processes requests .

EnableViewState

Gets or sets a Boolean indicating if the page (and any server controls it contains) maintains its view state when the current request ends.

ErrorPage

Gets or sets the page that is redirected to in case of an unhandled exception within the page.

ID

Gets or sets an identifier for the page.

IsPostBack

Gets a value indicating if the page is being loaded as the result of a postback operation.

IsValid

Gets a value indicating if page validation succeeded.

Request

Gets the HttpRequest (request intrinsic object) instance object for the current request, allowing access to HTTP information, such as POST and GET data.

Response

Gets the HttpResponse (response intrinsic object) instance object for the current request.

Server

Gets the HttpServerUtility (server intrinsic object) instance object for the current web request, providing utility functions for use in the current application.

Session

Gets the HttpSessionState (session intrinsic object) instance object for the current web request, enabling access to state persistence between stateless requests.

SmartNavigation

Gets or sets a value indicating if smart navigation is enabled.

Trace

Gets the System.Web.TraceContext instance object for the current web request, enabling access to performance information.

User

Gets a System.Security.IPrincipal interface object representing the current user's identity and roles.

Validators

Gets a ValidatorCollection collection of the validation controls for the page.

Visible

Gets or sets a Boolean indicating if the page is to be rendered.

Table A.3. Events of the System.Web.UI.Page Class

Event Name

Occurs When

AbortTransaction

A transaction is aborted.

CommitTransaction

A transaction is completed.

DataBinding

The server control binds to a data source.

Disposed

A server control is released from memory.

Error

An unhandled exception occurs.

Init

The server control is initialized .

Load

The server control is loaded into the Page object.

PreRender

A server control is about to render to its containing Page object.

Unload

The server control is unloaded from memory.

only for RuBoard


XML and ASP. NET
XML and ASP.NET
ISBN: B000H2MXOM
EAN: N/A
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net