Hi Arjen,
Data variable is null.
Because HttpContext.Current.Items["MySettings"] is returning null.
Try modifying GetData to assign a default value (empty ArrayList perhaps)
in the case that MySettings hasn't been assigned:
public static ArrayList GetData()
{
ArrayList data = (ArrayList) HttpContext.Current.Items["MySettings"];
if (data = null)
HttpContext.Current.Items["MySettings"] = data = new ArrayList();
return data;
}
--
Dave Sexton
Hmmm....
// Inside my ashx file
ArrayList data = GetData();
// Inside cs file in app_code dir
public static ArrayList GetData()
{
return (ArrayList)HttpContext.Current.Items["MySettings"];
}
Data variable is null.
I believe it have something to do with the processes that are currently
loaded, or not yet loaded... but I don't see a solution.
Arjen
"Michael Nemtsev" <
[email protected]> schreef in bericht
Hello Arjen,
We are really not the clairvoyants to know what's wrong without seing
your code. We need *worked* code to try to help u.
You can find the problem by yourself. see where the problem in line the
debugger screms, set the breakpoint and understand why that referenve
was not initialized.
A> Hi,
A> I get this wonderfull message when running my ashx file: Object
A> reference not set to an instance of an object.
A> I try to read data from the HttpContext. I think the problem is
A> around
A> here...
A> I have allready add IRequiresSessionState, but this did not help.
A> Suggestion?
---
WBR,
Michael Nemtsev :: blog:
http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents do
not cease to be insipid." (c) Friedrich Nietzsche