Session vs. viewstate

xiaoxiao2021-03-06  93

1, contrast.

Project ------------------------ Session --------- ViewState User Server Resources ----------- True ------------ Falsetime Out -------------------- True ------------ False stores any .NET type ----------- True ---------- False (only support Strings, Integers, Booleans, Arrays, ArrayList, Hashtable, Custom Typeconverters) increase HTML Load ---------------- False ---------- True

2, session is valid for the entire Application, and the viewState is equivalent to the session of a page; 3, definition

ViewState: // Save in ViewState ViewState ["Sortorder"] = "DESC"; // read from viewstate string sortorder = (string) ViewState ["Sortorder"];

Session: //

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

New Post(0)