Data Cache Problem

V

Vivian

I know that the data cache is for private use, is there any method to get
the cache value from another class? I have a public function to get the
cache value and error occurs when I call it from another class. Error :
Cache is not available.
Thanks.


The code is as follows:

public class WebForm1 : System.Web.UI.Page
{
public string GetCache(string name)
{
return Cache[name];
}
}

public class Openfile
{
public void open()
{
namespace.WebForm1 parentForm = new WebForm1();
string cachevalue;
cachevalue = parentForm.GetCache("filename");
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,158
Latest member
Vinay_Kumar Nevatia
Top