Passing Data between using a FORM

axum

Active member
Joined
Mar 28, 2003
Messages
40
Hi, i have a growing number of IDS that i need to pass to the same page via the <FORM>. I am using a Treeview which is populated via a Tabstrip (so depending on the Tab they are on the Treeview displays different data), so i need to be able to have a persistent record of the IDs that have been selected.

As the Data are IDS i think the best way of storing the values is using an ArrayList. How can i pass this Array within the page, can i insert it into a HIDDEN field?

Or if anyone else has any other suggestions that would be great.

Thanks

Axum
 
ok , i think im going to have to use a Session Variable to store my ArrayList. Does anyone know say AFTER a Postback i can get at this ArrayList again?

So something like this in my Page_Load :

private void Page_Load(object sender, System.EventArgs e)
{
// FIRST VISIT TO THE PAGE
if (!Page.IsPostBack)
{
ArrayList taxArray = new ArrayList();

taxArray.Add(1);

Session["myArray"] = taxArray;
}
else
{
// HOW DO I USE MY NEWLY CREATED SESSION ARRAYLIST?

ArrayList tempArray = Session["myArray"] - is how i thought, but i dont think this works....
}
 
yep, thanks for that...

I realised that the thing i was missing was this:

ArrayList tempArray = (ArrayList) Session["myArray"];

i forgot (well i didnt actually know you had to!) the (ArrayList) bit!!

Cheers,

Axum
 
Back
Top