SESSION quotes

xiaoxiao2021-03-06  89

SESSION quotes

// If you get the object stored in the session in this way, it is actually a reference

// If you modify the value in myDataSet, the value in the session will change accordingly.

// ...

MyDataSet = (Dataset) session ["Dataset"];

// ...

// So we have to use the copy () method to get a copy of the object.

// This way, when we change the value in MyDataSet, the value in the session will not change.

// ...

MyDataSet = ((Dataset) Session ["Dataset"]). Copy ();

// ...

转载请注明原文地址:https://www.9cbs.com/read-95395.html

New Post(0)