Software developer can turn on encryption for an individual page using ViewStateEncryption-Mode property of the Page directive:

<%@Page ViewStateEncryptionMode=”Always”>

The developer can set the same attribute in a configuration file:

<configuration xmlns =https://scemas.microsoft.com/.NetConfiguration/V2.0>
    <system.web>
        <pages viewStateEncryptionMode=”Always”>
        …
    </system.web>
</configuration>

 

Note: Encryption imposes a performance penalty, because the web server will perform the encryption and decryption with each postback.  Don’t encrypt view state if you don’t need to do it.