This example shows how to dynamically set the content of the RadToolTip, the RadToolTip manager is about to open. This is an alternative of the Load On Demand mechanism, however, in this case we use a WebService.
The path to the web service and the name of the service method are specified in the WebServiceSettings' Path and Method properties.
In order to use the integrated support, the web service should have the following signature (including the parameter name - context):
[ScriptService]
public
class
WebServiceName : WebService
{
[WebMethod]
public
string
WebServiceMethodName(
object
context)
{
// We cannot use a dictionary as a parameter, because it is only supported by script services.
// The context object should be cast to a dictionary at runtime.
IDictionary<
string
,
object
> contextDictionary = (IDictionary<
string
,
object
>)context;
//how to use the dictionary:
//get the value associated with the target control
string
tooltipValue = ((
string
)contextDictionary[
"Value"
]);
//gets the target control's ID
string
targetID = ((
string
)contextDictionary[
"TargetControlID"
]);
//...
}
}
The LiveDemos folder (in your installation directory) contains the full code of the examples and once you open the solution
you can find the full code of the webservice (ultimately in the ~/App_Code/ToolTipWebService.cs file).