I
I
il-il2014-07-18 08:45:38
Data storage
il-il, 2014-07-18 08:45:38

Is it possible to store data between PostBacks in a non-static class?

Good afternoon!
There is a dynamic .aspx page. It is filled in by the user with various data. I want this data to be saved between PostBacks in a non-static class located in a separate .cs file
. For example, a class:

class MyClass
{
  string a;
  string b;
}

Class Enrollment
MyClass my_class = new MyClass();
my_class.a = "значение 1";
my_class.b = "значение 2";

After PostBack, this data is lost. How to make the data stored in the class?
It is assumed that several users from different machines will work at the same time, so static fields cannot be used.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pi314, 2014-07-18
@il-il

Here is the answer with examples.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question