tags:

views:

63

answers:

2

Hello,

I have a 2D array of doubles in my Default class on my Default.aspx.cs page, like so:

protected Double[,] time;

By the time the page loads, I have populated this array from a database. Now, I want to reference this array in another file (Diff.aspx.cs) to avoid visiting the database again. Also, the data is used in a read-only fashion.


EDIT: There were some helpful links below. I have decided to attempt the hidden querystring/parse method. If anyone has a more straightforward answer, please suggest it. Thanks to everyone who wrote :D

+1  A: 

check this out there are several How To approaches

http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx

camilin87
A: 

Freakishly, I think you are trying to pass values (in your case, array) from one page to another page. You may refer to the link posted by camilin87. There are few ways to do this, like session state, viewstate, querystring, etc. There are pros and cons for each of the options, the most suitable option depends on your situation. You may ask if you need more clarification.

Here's a direct link for you if you are using .NET 4.0. http://msdn.microsoft.com/en-us/library/6c3yckfw%28v=VS.100%29.aspx

Gan
I don't think this is what I need. I remember using the extern keyword for a data structure once in c++, and everything just kinda "fell into place". It's a pity that this isn't part of C#.
Freakishly
The extern keyword IS part of C#, see here: http://msdn.microsoft.com/en-us/library/e59b22c5%28v=VS.100%29.aspxWhen you said "I want to reference this array in another file", what file is that? Is it a code-behind file of an aspx page within the same ASP.NET website?
Gan
Okay, I guess I now understand the perils of way too less information. Thanks, guys.
Freakishly
Read your updated post. Let us know if the querystring method works for you ok :)
Gan