Using C# and ASP.net, I have an array of doubles that is filled up with information from a file. When it is finally full it shows to the user how many fields are full in a label.
this code is to fill one array from a file, this code is inside a button.
double[] arrayX; //imagine this is a global variable.
string line;
int j = 0;
Stream data = FileUpload1.PostedFile.Inputstream;
StreamReader sr = new StreamReader(data);
line = sr.ReadLine();
while (line != null)
{
arrayX[j] = Convert.ToDouble(line);
j++;
line = sr.ReadLine();
}
label1.Text = j.ToString();
Now in the web browser it shows the number of elements like this:
No. of elements: __10___
if the user agrees with this number, he clicks the second button which will have to use the array that was filled for some other operation but in my webbrowser it says that the array is empty even if i have declare as a global variable.
So my question is, how can i read my array data from the second button?