ASPxClientUtils.GetCookie(name) Method
Retrieves a cookie with the specified name.
Declaration
static GetCookie(
name: string
): string
Parameters
Name | Type | Description |
---|---|---|
name | string | A string value that represents the name of a cookie. |
Returns
Type | Description |
---|---|
string | A string value, if the cookie exists. |
Example
This example demonstrates how to operate with cookies on the client, using the client ASPxClientUtils.SetCookie, ASPxClientUtils.GetCookie
and ASPxClientUtils.DeleteCookie methods of the ASPxClientUtils object.
The complete sample project is available in the DevExpress Code Central database at E1133.
function OnSelectedColorChanged(s, e) {
var color = s.GetSelectedItem().value;
document.body.style.backgroundColor = color;
ASPxClientUtils.SetCookie("backgroundColor", color);
}
function OnColorComboBoxInit(s, e) {
var color = ASPxClientUtils.GetCookie("backgroundColor");
document.body.style.backgroundColor = color;
if(color != null)
s.SetValue(color);
}
See Also