October 2010
Intermediate to advanced
1920 pages
73h 55m
English
Instead of using the aspnet_regiis tool to encrypt configuration sections, you can use the Configuration API. Specifically, you can encrypt a configuration section by calling the SectionInformation.ProtectSection() method.
For example, the ASP.NET page in Listing 34.26 displays all the sections contained in the system.web section group in a GridView control. You can click Protect to encrypt a section and UnProtect to decrypt a section (see Figure 34.14).
Figure 34.14. Encrypting and decrypting configuration sections.

Listing 34.26. EncryptConfig.aspx
When you click the Protect link, the grdSection_RowCommand() ...