Site Map | About Us | Contact Us  
 The same content in Microsoft HTML help file format is included in the download package.

ClientTemplate Class

Represents a client side template.

For a list of all members of this type, see ClientTemplate Members.

System.Object
   System.Web.UI.Control
      EO.Web.ClientTemplate

[Visual Basic]
Public Class ClientTemplate
    Inherits Control
[C#]
public class ClientTemplate : Control

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Client template defines a HTML snippet that contains zero or more "format items". Controls that support client template automatically evaluate these items on the client side when necessary. For example, The following code defines the FooterTemplate property of a Calendar control. It uses a built in variable today and also specifies its displaying format as MM/dd/yyyy. It also uses a built in image 00040106.

[HTML] 
<FooterTemplate>
<div style="FONT-WEIGHT: bold; FONT-SIZE: 11px; FONT-FAMILY: Tahoma"">
        <img src="{img:00040106}"> Today: {var:today:MM/dd/yyyy}
</div>
</FooterTemplate>

Each format item is of the form "{type:name[:format]}", where:

type description
img To insert a built-in image. The "name" parameter should be the ID of the built-in image.
var

To insert a "variable". The "name" parameter should be the ID of the variable, the "format" parameter specifies a format string that will be used to format the variable.

The variable can be a built-in variable supported by the control itself, or a custom variable. A custom variable is evaluated by calling ClientSideOnEvalVar client side event handler.

The following section lists all supported built-in variables:

EO.Web.WebControl
Variable Remark
"this" The client side object that represents this control. For example, "{var:this}.setSelectedDate()".
"clientId" The client ID of the object.
EO.Web.Calendar inherits all variables that EO.Web.WebControl supports and also supports the following variables:
Variable Remark
"today" Today's date.
"selected_date" The current selected date.
"visible_date" The first day of the first visible month.
EO.Web.Grid inherits all variables that EO.Web.WebControl supports and also supports the following variables:

Variable Remark
"total_pages" Total number of pages.
"current_page" The current page index. Note the first page index is 1. This is different from client side getCurrentPage function, which returns 0 based index.
"record_count" The total record count.

EO.Web.ImageZoom inherits all variables that EO.Web.WebControl supports and also supports the following variables:

Variable Remark
"big_image" The big image (zoomed out image) specified by BigImageUrl.
"description" A description specified by Description property.

Requirements

Namespace: EO.Web

Assembly: EO.Web (in EO.Web.dll)

See Also

ClientTemplate Members | EO.Web Namespace


Direct link to this topic