Recently we received a support ticket with a question whether RadHtmlPlaceholder provides support for cookies. By default, RadHtmlPlaceholder doesn't have a mechanism for reading/writing cookies. However, with the right bits of JavaScript, everything is possible :)
Imagine you have an HTML page which you want to read/write cookies to and all this has to happen from Silverlight.
First, you need few JavaScript methods for reading/writing cookies. Let's call the page we want to read/write cookies to CookiesPage.html.
<html>
<head>
<title>Cookies Page</title>
<script type="text/javascript">
// Create a cookie with the specified name and value
function SetCookie(name, value) {
document.cookie = name + "=" + value;
alert("Cookie successfully set");
}
// Retrieve the value of...