W
Wardeaux
I set a cookie in my code behind:
Dim cookieFocus As New HttpCookie("PMFocus")
cookieFocus.Value = "D"
Response.Cookies.Add(cookieFocus)
I read the cookie in my html page:
function doFocus(str)
{ var allcookies = document.cookie;
var pos = allcookies.indexOf("PMFocus=");
var mydate = new Date();
mydate.setFullYear(2000);
alert(allcookies);
if (pos != -1)
{
var start = pos + 8;
var end = allcookies.indexOf(";",start);
if (end == -1) end = allcookies.length;
var Myvalue = allcookies.substring(start,end);
alert(Myvalue);
if (Myvalue == "D")
{
alert("Found Cookie");
document.all(str).focus();
}
}
document.cookie = "PMFocus=E"
alert("here");
}
When I try to set the cookie to a new value it just creates new cookie by
the same name...
and when I change the value from my codebehind, it doesn't change the one
created by my clientside javascript
Any clues how to get them to work on the same cookie?
MTIA
wardeaux
Dim cookieFocus As New HttpCookie("PMFocus")
cookieFocus.Value = "D"
Response.Cookies.Add(cookieFocus)
I read the cookie in my html page:
function doFocus(str)
{ var allcookies = document.cookie;
var pos = allcookies.indexOf("PMFocus=");
var mydate = new Date();
mydate.setFullYear(2000);
alert(allcookies);
if (pos != -1)
{
var start = pos + 8;
var end = allcookies.indexOf(";",start);
if (end == -1) end = allcookies.length;
var Myvalue = allcookies.substring(start,end);
alert(Myvalue);
if (Myvalue == "D")
{
alert("Found Cookie");
document.all(str).focus();
}
}
document.cookie = "PMFocus=E"
alert("here");
}
When I try to set the cookie to a new value it just creates new cookie by
the same name...
and when I change the value from my codebehind, it doesn't change the one
created by my clientside javascript
Any clues how to get them to work on the same cookie?
MTIA
wardeaux