Connecting Tech Pros Worldwide Forums | Help | Site Map

Urgent help needed in cookie arrays

Raghu Raman
Guest
 
Posts: n/a
#1: Nov 19 '05
Hi,

In javascript file i store 3 values under a single cookie array ,like

var myarray = new Array(null);
myarray["a1"] = "field_1";
myarray["a2"] = "field_2";
myarray["a3"] = "field_3";
document.cookie ="myarray=" + myarray;

it is successfully executed.But i can not retrieve the stored cookie
values in my c#.net code.

***
Could u pls tell me the way i stored the cookie array in javascript is
right?if not pls tell me how.

***If so pls tell me how can i retrieve the stroed values in my c#.net
code.


Thanks & Regards
Raghu




*** Sent via Developersdex http://www.developersdex.com ***

sarathy
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Urgent help needed in cookie arrays


Request.Cookies.Get("myarray").Value will give you a comma separated value of
the array values. use the strings split function to get the array back
BTW for this to work u shud use myarray[0] , myarray[1] ... instead on a1,a2

"Raghu Raman" wrote:
[color=blue]
> Hi,
>
> In javascript file i store 3 values under a single cookie array ,like
>
> var myarray = new Array(null);
> myarray["a1"] = "field_1";
> myarray["a2"] = "field_2";
> myarray["a3"] = "field_3";
> document.cookie ="myarray=" + myarray;
>
> it is successfully executed.But i can not retrieve the stored cookie
> values in my c#.net code.
>
> ***
> Could u pls tell me the way i stored the cookie array in javascript is
> right?if not pls tell me how.
>
> ***If so pls tell me how can i retrieve the stroed values in my c#.net
> code.
>
>
> Thanks & Regards
> Raghu
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
>[/color]
Raghu Raman
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Urgent help needed in cookie arrays




Dear Sarathty,

Thx for that,i wll try and getback to u.

Regards
Raghu


*** Sent via Developersdex http://www.developersdex.com ***
Closed Thread