R
R.A.M.
I am learning ASP.NET.
In Global.asax file I have such code:
....
<%@ Import Namespace="System.Web.Caching" %>
....
void Application_Error(object sender, EventArgs e)
{
Exception ex = (Exception) Server.GetLastError();
if (ex != null)
Cache["Problem"] = ex.Message; // HERE PROBLEM
else
Cache["Problem"] = ""; // HERE PROBLEM
Server.Transfer("Problem.html");
}
....
The problem-error is: "'System.Web.Caching.Cache' is a 'type' but is
used like a variable."
How to write it correctly?
Thank you!!!
/RAM/
In Global.asax file I have such code:
....
<%@ Import Namespace="System.Web.Caching" %>
....
void Application_Error(object sender, EventArgs e)
{
Exception ex = (Exception) Server.GetLastError();
if (ex != null)
Cache["Problem"] = ex.Message; // HERE PROBLEM
else
Cache["Problem"] = ""; // HERE PROBLEM
Server.Transfer("Problem.html");
}
....
The problem-error is: "'System.Web.Caching.Cache' is a 'type' but is
used like a variable."
How to write it correctly?
Thank you!!!
/RAM/