JaxcentPage is the base class from which all Jaxcent URL handlers need to be derived. In cases where no particular handler is needed (when using auto-session-management and when no data verification is needed), this class can be specified directly as the handler.

This class provides events to process page level operations (load/unload.) It also provides various common utility methods, such as showing JavaScript alert (dialog box) messages.

Namespace: Jaxcent.Web
Assembly: Jaxcent (in Jaxcent.dll) Version: 2.3.1.0 (2.3.1.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public class JaxcentPage
Public Class JaxcentPage
public ref class JaxcentPage

Members

               
 All Members  Constructors   Properties   Methods   Events  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
JaxcentPage()()()()
Default constructor.
JaxcentPage(Boolean)
Constructor with a "use-session" initializer.
JaxcentPage(Page)
Use this constructor to connect a JaxcentPage to an ASP.NET page. This constructor writes out the necessary JavaScript include statement to the page, with the Jaxcent connection-id as agrument. This must be called no later than "pre-render" on the page. Page_Load is too late to call this constructor.

A good place to invoke this constructor is in the constructor of the ASP.NET page.

Also, ASP.NET requires that a form with "runat=server" be present for this, so if you have removed the initial markup, you must put in at least an empty <form runat="server"></form> in there.

JaxcentPage(Boolean, Boolean)
Constructor with "use-session" and "auto-session" initializers.
JaxcentPage(Page, Boolean)
Similar to the constructor with single "aspDotNetpage" parameter, but also sets "UseSession". If UseSession is true, a JaxcentSession will be added to the page.
JaxcentPage(Page, Boolean, Boolean)
Similar to the constructor with single "aspDotNetpage" parameter, but also sets "UseSession" and "AutoSession". If autoSession is true, all form data from the page will automatically be retrieved into session when the page is unloaded (e.g. if user nagivates away from page.)
CheckElementExists(SearchType, String, Int32)
Check if an element exists, without attempting to assign it to an object.
ClientCultureInfo
Get the remote locale if specified in HTTP Accept-Language header. (If not specified, returns server's default locale.)
ClientIPAddress
Get the client IP address.
CurrentPath
Get the path of the URL that is being processed.
DeleteCookie(String)
Delete cookie.
DeleteElementById(String)
Delete an element referenced by an ID.
DisableSubmitOnEnter()()()()
Single text/password fields in FORM elements cause a SUBMIT action.

This method can be called to disable this particular behavior by disabling the enter key for TEXT and PASSWORD.

Equals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
EvalJavaScriptCode(String)
Execute JavaScript code, wait for results.

Same as EvalJavaScriptCode( code, false, null );

EvalJavaScriptCode(String, Boolean, array<Object>[]()[][])
Same as ExecJavaScriptCode, but waits for the result of the evaluation and returns it.
ExecJavaScriptCode(String)
Execute JavaScript code, do not wait for results. Same as ExecJavaScriptCode( code, false, null );
ExecJavaScriptCode(String, Boolean, array<Object>[]()[][])
Call JavaScript, do not wait for results.

The arguments array can contain strings, Integers, Doubles, strings, bool, Integers, Jaxcent HTML Elements, or it can be null. If the argument array is not null, the "code" is just a JavaScript function name, and must not contain the parentheses character. In this case, the characters "( )" containing any arguments are appended to the "code". The array specifies the list of parameters. If the argument array is null, the "code" is evaluated as is, as an expression. To call a function with no args, use the form ExecJavaScriptCode( "myFunction()", null, false );

If the "argsAsArray" argument is true, the JavaScript function will be called with a single argument, which will be an array. Otherwise, the "args" array will be used as a list of arguments.

Finalize()()()()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
GetAcceptedLanguages()()()()
Get a list of remote locales if specified in HTTP Accept-Language header. The most preferred locale is first, followed by other locales in order of preference. (If none specified, returns server's default locale.)
GetAllFormData()()()()
Retrieve all form data on page. The data must be identifiable with a name or an ID. In addition to INPUT tags, also retrieves data from SELECT and TEXTAREA tags.

The returned Map maps names or ids, to values.

Multile checkboxes can have the same name and multiple values. These are separated by commas. If the checkbox (or none of the checkboxes) is not selected, there will still be a value, and this value will be an empty string.

For lists (SELECT), the value contains of a selected index, followed by a colon character and the text selected. (Convenient utility functions JaxcentObject.getSelectedIndex and JaxcentObject.getSelectedValue are available to parse it.)

GetAllSessionData(Boolean)
Get all data from session so far. If the "getFromCurrentPage" parameter is true, first retrieve current page's data into session, otherwise just returns the data collected so far.

This method is only available if auto-session-data is set to true. If getFromCurrentPage is true, this method cannot be called from the constructor (before page loading.)

GetClientJaxcentURL()()()()
Returns the URL used in the client for Jaxcent. The default is /JaxcentDotNet23.js This is different from JaxcentFramework.JaxcentJavaScriptURL - though normally both should be the same, this method reports the actual url used in this particular page instance.
GetClientVersion()()()()
Returns a string describing the connected page's version number as reported by the JavaScript on the page. E.g. "2.3.1". It should be the same as the Jaxcent version.
GetCookie(String)
Get cookie value.
GetCookies()()()()
Get cookies from page as name->value pairs.
GetFormSaveEnabled()()()()
For AutoSessionData pages, returns whether saving form data in session upon page unloads, is enabled. This behavior is enabled by default, but can be turned off programmatically.
GetHashCode()()()()
Serves as a hash function for a particular type.
(Inherited from Object.)
GetJaxcentVersion()()()()
Return Jaxcent version.
GetQueryParameter(String)
Get the query parameter specified on the URL after a ? by a given parameter name.
GetQueryParameters()()()()
Get the query parameters (part of query-string after ?) as a name/value pair dictionary.
GetSelectedIndex(String)
The data returned for SELECT elements is of the form

CopyC#
selected-index: selected-option-value

This method can be used to retrieve the selected index from the data.

GetSelectedValue(String)
The data returned for SELECT elements is of the form

CopyC#
selected-index: selected-option-value

This method can be used to retrieve the selected value from the data.

GetType()()()()
Gets the Type of the current instance.
(Inherited from Object.)
GoBack()()()()
Navigate back.
GoForward()()()()
Navigate forward.
JaxcentConnectionID
Jaxcent Connection ID can be used to set up the Jaxcent connection manually
MakeContentURL(String, array<Byte>[]()[][])
Returns a URL that will return a given content-type and bytes. The information is placed in the session. The URL is based upon the Jaxcent URL, and can be used for applications such as generating a PDF file. Session must be available for the page. The information can be removed from the Jaxcent session by calling the method JaxcentSession.RemoveContentURLData.

This method can only be called if "use-session" was set to true, Note that even after "use-session" has been set, the session is not available in the constructor, it only becomes available after OnPageLoaded event has fired.

MemberwiseClone()()()()
Creates a shallow copy of the current Object.
(Inherited from Object.)
Navigate(String)
Navigate to a given URL.
OnClientRequestReceived
Handle this event to process data from JavaScript methods sent by calling the "JaxcentServerRequest( args... );" function defined by the Jaxcent JavaScript file.

The JavaScript call is asynchronous and does not wait for server response -- if it is required to process a server response in JavaScript, define a function in JavaScript and call that function via ExecJavaScriptCode or EvalJavaScriptCode, from your override of this method.

If JaxcentServerRequest was called at the client with no arguments, this method is called with null args. If JaxcentServerRequest was called with 1 arg, this method is passed that arg as "cmd", the "args" is null. Otherwise, "cmd" is the first arg passed to JaxcentServerRequest, and "args" contains the rest of the args.

OnFinalFormData
Event to receive form data during page unloading. The data has the same format as GetAllFormData. But at this time, no further interactions with the page are possible. The data can be saved in the session, or otherwise processed. Field verifications cannot be done here. For field verifications, add handler on buttons or other fields, and retrieve the data either with the event or by calling GetAllFormData().
OnPageLoaded
Jaxcent page-loaded event
OnPageUnloaded
Jaxcent page-unloaded event. Exceptions during handling this event are displayed via JaxcentFramework.JaxcentExceptionHandler
QueryString
The full query-string for the current page (the part after ?). To retrieve values for individual parameters, use GetQueryParameters() or GetQueryParameter(name)
ResetFromSession()()()()
Reset form data from session. Session must be available. This can be used to implement a "Reset" button.
ServerAccess(String)
Access a URL on the same server, from the client-browser. No new window is opened on the client, and the results of the retrieval are discarded. This method is provided for book-keeping type tasks on the server, e.g. accumulating report statistics.
Session
The session for the current page. It will be null unless "use-session" was set for the page. Also note that the session is not initialized (and will be null) until the page-loaded event has fired.
SetBatchUpdates(Boolean)
Used to hold updates without sending them out to the client. This can improve performance by sending out a number of updates all at once.

If batch-updates has been set to true, no further data will be sent to the client until batch-updates is reset to false! This should be done in a try-finally clause.

Important: Do not attempt to retrieve data from page while batch-updates is true!

SetCookie(String)
Add cookie to page. cookiestring must be a correctly formatted cookie string.
SetCookie(String, String, Nullable<(Of <<'(DateTime>)>>), String, String, Boolean)
Add cookie to page. Expires, domain, path may be null.
SetFormSaveEnabled(Boolean)
Enable or disable saving of form data from current page into session, for AutoSessionData management. By default, this is enabled. To program the Reset/Submit type of behavior of earlier FORMs based web applications, disable saving form to session in the constructor, then in the Submit (or other button) handler, enable saving again before navigating away from the page.
ShowConfirmDialog(String)
Show JavaScript confirm dialog box to the user. Returns true for confirmation, false for cancellation.
ShowInputDialog(String, String)
Show JavaScript prompt dialog box to the user. If the defaultResult is not null, the input dialog is initialized with this text. If the user cancels, the returned value is null, otherwise it is the input from user.
ShowMessageDialog(String)
Show JavaScript alert dialog box to the user.
StatusText
Get/Set status text on client HTML page
ToString()()()()
Returns a String that represents the current Object.
(Inherited from Object.)

Inheritance Hierarchy

System..::..Object
  Jaxcent.Web..::..JaxcentPage

See Also