将子窗口引用的数组对象从客户端传递到服务器端 [英] pass array object of child window references from client side to server side

查看:49
本文介绍了将子窗口引用的数组对象从客户端传递到服务器端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




这是我的场景

i我在javascript中有一个包含数据的数组变量。

同时刷新或回发这些变量丢失了,我无法在刷新/回发后获得变量中的那些数据


请告诉我如何将这些变量存储回服务器之前重新打包并带回来



注意:我使用asp.net作为服务器端

谢谢,


Raj

解决方案


hi,


这是我的场景

i我在javascript中有一个包含数据的数组变量。

同时刷新或回发这些变量丢失了我做了' '刷新/回发后能够在变量中获取这些数据


请告诉我如何在重新连接之前将这些变量存储到服务器并将其重新载入负载



注意:我使用asp.net作为服务器端

谢谢,


Raj



你可以用Cookie做到......但问题是你不能在Cookie中存储数组.....你有将它存储为字符串


Debasis Jana



你可以使用Cookie来实现它....但问题是你不能在Cookie中存储数组.....你必须将它存储为字符串


Debasis Jana


感谢JANA,


但是我正在尝试的是

而onload和onunload数组数组对象存储在hdnfield中

和加载后,它在javascript中恢复了

...

window.onload = setChilds(" htmHdnChild");


...

< body onunload =" getChilds(''htmHdnChild'')">



函数setChilds(HdnID)

{

alert(" in set child");

var hdnCtrl = document.all(HdnID);

if(hdnCtrl!= null )

{

myChild = hdnCtrl;

alert(myChild.length);

}

}


function getChilds(HdnID)

{

// alert(" in Get child) ;

var hdnCtrl = document.all(HdnID);

alert(myChild.length);
hdnCtrl.value = myChild;

alert(hdnCtrl);

}


在为隐藏字段设置数组对象时,它对我不起作用有没有其他方式


谢谢


但是我正在尝试的是

on onload和onunload the array数组对象存储在hdnfield

并且在加载时,它在javascript中恢复了

...

展开 | 选择 | Wrap | 行号


hi,

here is my scenario
i am having a array variable in javascript which contains data.
while refreshing or postback these varibles got lost and i did''nt able to get those data in the variables after a refresh/postback

please give me idea how to store back these variable to server before rereshing and taking them back on load


note: i am using asp.net as server side
Thanks,

Raj

解决方案

hi,

here is my scenario
i am having a array variable in javascript which contains data.
while refreshing or postback these varibles got lost and i did''nt able to get those data in the variables after a refresh/postback

please give me idea how to store back these variable to server before rereshing and taking them back on load


note: i am using asp.net as server side
Thanks,

Raj

you can do it using Cookie ...... but the problem is you can''t store Array in Cookie ..... you have to store it as String

Debasis Jana


you can do it using Cookie ...... but the problem is you can''t store Array in Cookie ..... you have to store it as String

Debasis Jana


Thanks JANA ,

but what i am trying is
while onload and onunload the array array object is stored in hdnfield
and on load, its got restored in the javascript
...
window.onload = setChilds("htmHdnChild");

...
<body onunload = "getChilds(''htmHdnChild'')">


function setChilds(HdnID)
{
alert("in set child");
var hdnCtrl = document.all(HdnID);
if (hdnCtrl!=null)
{
myChild = hdnCtrl;
alert(myChild.length);
}
}

function getChilds(HdnID)
{
//alert("in Get child");
var hdnCtrl = document.all(HdnID);
alert(myChild.length);
hdnCtrl.value = myChild;
alert(hdnCtrl);
}

while setting the array object for the hidden field, its not working for me is there there any other way

Thanks


but what i am trying is
while onload and onunload the array array object is stored in hdnfield
and on load, its got restored in the javascript
...

Expand|Select|Wrap|Line Numbers


这篇关于将子窗口引用的数组对象从客户端传递到服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆