Objects of this class (or classes that inherit it) are used to manage interactions with the browser page.
Each instance of
JaxcentPage (or an inherited class) manages the Jaxcent connection
to one browser page. This is similar to .ASPX code-behind object instances, but unlike .ASPX, the
JaxcentPage instance is not discarded after each round trip between the browser and the server.
Instead, the instance stays in use as long as the visitor stays on that page. The lifetime
JaxcentPage object could involve several user interactions.
Jaxcent can be used with
If you are using Jaxcent to assist with an ASPX page, you will need to declare and
object in the .ASPX page's code-behind, and add Jaxcent event-handlers and Jaxcent method calls there.
If you are using Jaxcent to work with a raw HTML page, you will need to define a class that
JaxcentPage, and put all your Jaxcent programming in that class.
Corresponding to all of these types of HTML elements, there are Jaxcent classes, such as
Jaxcent.Web.Html.JaxcentTable for <TABLE>:,
Jaxcent.Web.Html.JaxcentInputButton for <INPUT TYPE="BUTTON"> etc.
In addition, there is a
can be used for any unusual tags not already covered.
For each HTML element on the page that the programmer is interested in, an object of the corresponding Jaxcent class needs to be instantiated. This object has to be told which of the possibly multiple HTML elements on the page it needs to manage. This can be conveniently done with an "ID" (though there are other mechanisms as well.) E.g., the para of interest is marked with an id "MyPara"
<P id="MyPara">Text of the para</P>
JaxcentParais instantiated with this id, e.g.
JaxcentPara para = new JaxcentPara( jaxcentPage, "MyPara" ); // C# Dim para As New JaxcentPara( jaxcentPage, "MyPara" ) ' VB
The Jaxcent programmer can also create new HTML elements and add them to the page.
will change the existing contents of the para. The styles and other attributes can also be changed similarly.
para.InnerText = "New Textual Content"
Varius events can be received from the "para" in the example above, e.g.
OnClick which is fired
when the user clicks anywhere in the para. (Though from a UI point of view, it is common
to react upon clicks on buttons, or HREF links, rather than upon clicks on paragraphs.)
To receive events from a
JaxcentPara or a
JaxcentStdButton (which corresponds to <BUTTON> tags), simply add
a handler for the appropriate event.
There are often multiple versions of
OnClick available, and the data transfer
depends on the actual event(s) which has been provided a handler. Instead of providing a handler
OnClick on a button, you can choose to provide a handler
OnClickWithPageData event - in which case Jaxcent will also
deliver to you the current contents of any user-input form elements (such as TEXT, CHECKBOX, TEXTAREA) along
with the click event. This reduces the number of client-server round-trips, and
improves responsiveness and performance.
JaxcentPage itself has some events. The
event can be used to initiate actions that need to be taken after the page has
loaded. Until the page has been loaded, the Jaxcent sessions
are not available. Also, until the page has been loaded, the input elements
such as TEXT, CHECKBOX etc cannot be actively queried by the program. Such actions can be handled in an
Note: Because Visual Studio is not Jaxcent-aware, event bodies cannot be
generated simply by double-clicking on a form element. However, adding events
directly is very simple in Visual Studio. In C#, this is done by typing the
object name, a dot, the event name, the += characters, and then two TABs. E.g.
button.OnClick += <TAB> <TAB>
In Visual Basic, the "CODE" view can be used to select "button" on the left, and "OnClick" on the right, which will generate the event handler.
JaxcentTable class provides various commonly used
"Grid" features, e.g. updating from a
DataTable, even/odd row
styling, inserting row-specific
links, buttons etc in each row, and table cell editing.
JaxcentUploadForm class provides convenient methods for
JaxcentImage class provides methods for
setting any image in the <IMG> tag beyond the normal
setting of the "SRC" to an existing image file such as JPEG or PNG - in
Jaxcent the image being set could very easily be bytes read dynamically
from a .JPEG file, or could be something
that was created using
System.Drawing or some other
image-creation API on the fly.
Jaxcent sessions are also different from standard Web sessions. Instead of making a guess on a timeout, e.g. "the user has not clicked on anything for 20 minutes, we can delete the user's session", Jaxcent sessions provide fine-grained control over the timeout. By default Jaxcent session timeouts do not start as long as the user stays on a page with that session. (The programmer can manually delete the session after a given time interval for security or other reasons.) Because the timeout doesn't start until the user leaves the session pages, Jaxcent timeouts can be smaller, defaulting to 5 minutes. This minimizes the number of unused sessions residing on the server, further improving server performance.
Furthermore, Jaxcent's design also allows Jaxcent to offer full automation of the common web-paradigm of collection form input data into session. If enabled, Jaxcent will collect form input data at page unloading, and will automatically save it in the session.