The ObjectGateway type exposes the following members.

Constructors

  NameDescription
ObjectGateway
Initializes a new instance of the ObjectGateway class

Methods

  NameDescription
LoadControlState
Restores control-state information from a previous page request that was saved by the SaveControlState method.
(Overrides Control..::.LoadControlState(Object).)
OnInit
Event handler for the init event.
(Overrides Control..::.OnInit(EventArgs).)
OnPreRender
Prepare the rendering of the control.
(Overrides Control..::.OnPreRender(EventArgs).)
Render
Render a javascript statement instantiating a javascript value equivalent to the object given to the property SourceObject and assigning it to a variable named as the value of property VariableNameOnClientSide.
(Overrides WebControl..::.Render(HtmlTextWriter).)
SaveControlState
Saves any server control state changes that have occurred since the time the page was posted back to the server.
(Overrides Control..::.SaveControlState()()().)

Properties

  NameDescription
SourceObject
Gets or sets the cso-compatible object from which the javascript value will be created.

Remarks

It is not necessary to re-assign the server-side object on every post-back. The generated string of javascript code is store in the control state on the first request to the page. The assignment of the object can be put in an
CopyC#
if(!IsPostBack){...}
block of code in the Page_Load method. If the server-side object changes and the changes need to be reflected on the client side, re-assign the object to this property. The control state will invalidated and the server-side object will be sent to the Object Gateway again.
TrapException
For debug purposes. Gets or sets a value defining if exceptions should be caught and the exception message assigned to the variable instead of letting the exception reach the surface.
VariableNameOnClientSide
Gets or sets the name of the variable to which the newly created javascript value will be assign to.

See Also