Avoid loosing html array after postback

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to hold references to several window objects

var win = window.open(...

in a javascript array

AND

not loose the elements in this array when the .aspx page is reloaded after
one of its WebForm component causes a postback to the server.

How?
 
You can convert your array to a string (XML nodes, or comma-separated
values), then store it in a hidden field (input type="hidden"), and add a
'runat="server"' attribute to the hidden field. This will allow the hidden
field to store its value in the ViewState between postbacks.

Cheers,
John Wadie
 
Hi,

Humm, I had never thought of this .. the value returned should be of type
window , not sure that you can send it to the server in a hidden field..

so the only slution I can think of is using frames, you may have one frame
to just old the references that you neeed and the other frame can make as
many postback as needed they referenced values will be kept in the static
frame.

maybe in a javascript NG you find some better answers...


cheers,
 
Back
Top