Methods, Properties, Attributes
| AJAXPage - Server-Side
|
| | |
OboutInc.oboutAJAXPage
namespace
<%@ Register TagPrefix="oajax" Namespace="OboutInc" Assembly="obout_AJAXPage" %>
Methods
ExecBeforeLoad
|
Triggers a client-side function from the server, before the data processing starts.
ExecBeforeLoad(clientFunction)
-
clientFunction - Javascript function that will be executed. Can be a javascript code or the name of a javascript function.
ExecBeforeLoad("alert('some text')");
View ExecBeforeLoad tutorial.
|
ExecOnLoad
|
Triggers a client-side function from the server, after the processing is over.
Scripts added with this method are not executed on a synchronous callback and if errors are turned on,
it will be reported as an error.
ExecOnLoad(clientFunction)
-
clientFunction - Javascript function that will be executed. Can be a javascript code or the name of a javascript function.
ExecOnLoad("alert('some text')");
View ExecOnLoad tutorial.
|
EndResponse
|
Stops the execution at server-side and returns to the client the data processed until that moment.
EndResponse()
Does not require any parameters.
EndResponse();
View EndResponse tutorial.
|
Redirect
|
Redirect to another page.
Redirect(pageURL, endResponse)
-
pageURL - URL of the page where you will be redirected.
-
endResponse - Specifies if the processing of the current page should end.
If true, the processing of the current page is over. Default value is false.
Optional.
Redirect("SomePage.aspx");
Redirect("SomePage.aspx", true);
|
ShowAlert
|
Shows an alert window with the specified message on client side.
ShowAlert(message)
-
message - Text that will be displayed inside an alert box.
ShowAlert("This alert was sent by server");
View ShowAlert tutorial.
|
SetValue
|
Set the value of an element with specified id.
SetValue(elementID, value);
- elementID - Element id.
- value - New value for the element.
SetValue("textElement", "some value");
View SetValue tutorial.
|
OpenWindow
|
Open a new window at client.
OpenWindow(pageURL, mode, properties, replace);
- pageURL - Open window URL.
- mode - Open window mode. Available values are _bank, _self, _parent, _top.
- properties - Window properties.
- replace - Specifies whether the URL creates a new entry or replaces the current entry in the history list.
The following values are supported:
true - URL replaces the current document in the history list
false - URL creates a new entry in the history list
Optional.
OpenWindow("Postback2.aspx",);
OpenWindow("Postback2.aspx", "_blank",);
OpenWindow("Postback2.aspx", "_blank", "width=400, height=250");
OpenWindow("Postback2.aspx", "_blank", "width=400, height=250", true);
View OpenWindow tutorial.
|
ShowConfirmationDialog
|
Shows a confirm dialog box with a specified message.
If the answer is Yes, server method is executed with the specified list of parameters.
ShowConfirmationDialog(message, serverMethod, parametersList);
- message - Text displayed inside confirmation dialog.
- serverMethod - If the answer is yes, serverMethod is called.
- parametersList - List of parameters for myFunction. Optional.
Hashtable ht = new Hashtable();
ht.Add("param1", 1);
ht.Add("param2", "a");
ShowConfirmationDialog("Are you sure?", "Confirm", ht);
public string Confirm (bool response, int param1, string param2)
{
return "some text";
}
View ShowConfirmationDialog tutorial.
|
CreateTimer
|
Creates a timer, with an ID, that will trigger a client function on a time interval.
CreateTimer(ID, clientFunctionToCall, interval);
- ID - ID of the timer.
- clientFunctionToCall - Function to call on client.
- interval - Time in milliseconds on which the clientFunctionToCall is called.
CreateTimer("timerID", "myClientFunction()", 1000);
Creates a timer, with an ID, that will trigger a server function on a time interval.
CreateTimer(ID, serverFunctionToCall, clientFunctionToCall, interval);
- ID - ID of the timer.
- serverFunctionToCall - Server side function that will be called at every interval,
and which can return something that clientFunctionToCall can process.
- clientFunctionToCall - Client side function that will be called with the result of serverFunctionToCall.
If you need no client side function to be called, just set it tonull.
- interval - Time in milliseconds on which the serverFunctionToCall is called.
CreateTimer("timerID", "myServerFunction", "myClientFunction()", 1000);
CreateTimer("timerID", "myServerFunction", null, 1000);
View CreateTimer tutorial.
|
CancelTimer
|
Cancel the timer specified by its ID.
CancelTimer(ID);
CancelTimer("myTimer");
View CancelTimer tutorial.
|
RegisterScript
|
Registers a client script block.
RegisterScript(ScriptKey, Script);
- ScriptKey - The key of the client script block to register. Must be unique.
- Script - The client script script block to register.
RegisterScript("alertScript", "alert('this is an alert')");
|
RegisterScriptFile
|
Registers a client script resource file.
RegisterScriptFile(ScriptFileKey, ScriptFilePath);
- ScriptFileKey - The key of the script file resource to register. Must be unique.
- ScriptFilePath - The client script file path.
RegisterScriptFile("scriptResource1", "http://localhost/MyWebsite/ScriptFile.js");
|
RegisterStyleFile
|
Registers a css style resource file.
RegisterStyleFile(StyleFileKey, StyleFilePath);
- StyleFileKey - The key of the css style file resource to register. Must be unique.
- StyleFilePath - The css style file path.
RegisterStyleFile("styleResource1", "http://localhost/MyWebsite/StyleFile.css");
|
|
|
|
|
Properties
IsCallback
|
Returnstrueif the call is a callback,falseotherwise.
|
EnableCallbackViewState
|
If true, the ViewState
will be available during callbacks. Also check this live example.
|
RequestTimeoutMilliseconds
|
The timeout in milliseconds after which a request is considered to be timeout.
This time is calculated from when the request is initiated - ob_OnRequestStart.
When it expires, ob_OnTimeout function is called.
|
ThrowExceptionsAtClient
|
Whether or not to throw an exception at client when an error occurs.
|
ShowErrorsAtClient
|
Whether or not to show an alert box at client when an error occurs with details about the error.
|
ScriptPlaceHolder
|
Specify the ASP Literal control where the component client script will be generated.
If none specified, the script will be generated inside<head>tag of your page.
|
ServerFileName
|
Name of the file where the data is processed.
If none specified, the data will be sent to the same page.
|
|
|
|
|
Attributes
JSVisible
|
Using this attribute to a server method makes your method available also on client side.
View JSVisible tutorial.
|
|
|
|
|
| "I wanted to say this is probably the best set of tools I have ever worked with,
but the fact that you guys answer questions is phenomenal.
I recommend your stuff to every developer I talk to.
" |
Karl Wilkens |
| Multiweb Communications, Inc. |
| | |
|