Keep an arraylist alive between Page_Load

  • Thread starter Thread starter Ignacio Machin \( .NET/ C# MVP \)
  • Start date Start date
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You have to recreate them indeed, the easier solution is to store the list
in Session


cheers,
 
Hi, Im using C# in a web solution - I have a bunch of LinkButtons that are
dynamically created on my page according to an arraylist. My understanding
is that When I click one of those linkbuttons at runtime, the page has to
load again and those conrtrols have to be re-created before the click event
can be handled. The problem Im having is that the arraylist I originally
used to build the controls, is not available anymore. How do I keep this
arraylist alive? Or whats a more efficient way to build these controls?
Heres what Im doing:

private void Page_Load(object sender, System.EventArgs e){
//When the page first loads I use a context handler to get the arraylist
from the calling page:
if (!IsPostBack){
DummyRun sourcepage = (DummyRun) Context.Handler;
ArrayList objResultsArray = sourcepage.DummyRunResults;
Buildtable();
}
}

Thanks,
Grant
 
Back
Top