The Web DataWindow server control and client control

The Web DataWindow has two main components: the server control and the client control.

Web DataWindow server control

The WebDataWindowControl is a custom Web server control that inherits from the System.Web.UI.WebControls.WebControl class, which in turn derives from the System.Web.UI.Control class. It also implements the System.Web.UI IPostBackEventHandler and IPostBackDataHandler classes.

Internally, the WebDataWindowControl uses an instance of the DataStore class to expose methods and properties and render the DataWindow in the selected rendering format.

Figure 9-1: WebDataWindowControl class hierarchy

The image shows the WebDataWindowControl class hierarchy described above.

The Web DataWindow server control retrieves data from a database and returns JavaScript and XSLT, XHTML, or HTML that represent the data and the DataWindow object definition to the page server. The server control uses a DataStore internally to handle retrieval and updates.

The control provides most of the methods available on the DataWindowControl, as well as additional methods used to manage context and data caching.

Web DataWindow client control

The Web DataWindow client control is the JavaScript plus XML, XSLT, and CSS (for the XML RenderFormat), the JavaScript plus XHTML (for the XHTML RenderFormat), or the JavaScript plus HTML (for the HTML RenderFormat), that is generated by the server control and embedded in the page or in associated internal files returned to the Web client. Client-side scripts that you add to your Web page and wrap in SCRIPT tags are embedded as JavaScript in the client control.

JavaScript caching Some features available on the client control are optional: events, methods, data update and validation, and display formatting for newly entered data. The size of the generated JavaScript increases as you add more client-side functionality. You can cache client-side methods in JavaScript files on your Web server to reduce the size of the markup generated for Web DataWindow pages and, if the browser is configured to use cached files, improve the performance on the client machine.

For information about enabling JavaScript caching, which you can set up in the Properties window for the control in Visual Studio, see “Generating JavaScript for common management tasks”.

Using client-side events and methods Events that are triggered on the client control do not require the server control to reload the page, so processing on the client is typically much faster than processing on the server.

For more information about enabling features on the client, see “WebDataWindowControl properties” and “DataWindow object properties for the Web DataWindow”. For more about writing scripts and lists of client-side events and methods, see Chapter 12, “Writing Scripts for the Web DataWindow Client Control.”

For more information about the events and methods available on the server control and the properties used to implement the events available on the client control, see the online Sybase DataWindow Help in Visual Studio or the dwref25.chm compiled HTML Help file.