SessionPageStateSection.DefaultHistorySize Field

 

Defines the size of the page history.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

public const int DefaultHistorySize

Field Value

Type: System.Int32

The following code example shows how to obtain the DefaultHistorySize property from the configuration file associated with an existing Web application.


// Get the history size.
int historySize =
    sessionPageState.HistorySize;

string msg = String.Format(
"Current history size: {0}\n",
historySize.ToString());

Console.Write(msg);


if (!sessionPageState.IsReadOnly())
{
    // Double current history size.
    sessionPageState.HistorySize =
        2 * sessionPageState.HistorySize;

    configuration.Save();

    historySize =
        sessionPageState.HistorySize;

    msg = String.Format(
    "New history size: {0}\n",
    historySize.ToString());

    Console.Write(msg);
}

.NET Framework
Available since 2.0
Return to top
Show: