From what I've read, an array can be stored in viewstate but from what I've tried ... I've been very unsuccessful in making this happen. How does one accomplish this?
These are some important snippets of my code:
When the page is loaded the array is populated. When the button is clicked I want to reuse the list without having to repopulate it.
Any ideas?
- VBRookie
These are some important snippets of my code:
Code:
protected String[,] employeeArray = new String[100, 3];
private void Page_Load(object sender, System.EventArgs e)
{
if ( !Page.IsPostBack )
{
retrieve_employees();
(string[,])ViewState["employees"] = employeeArray;
setCounterValues();
}
}
public void btnNext_Click(object sender, ImageClickEventArgs e)
{
employeeArray = (string[,])ViewState["employees"];
setCounterValues();
}
When the page is loaded the array is populated. When the button is clicked I want to reuse the list without having to repopulate it.
Any ideas?
- VBRookie