Sunday, March 18, 2012

ViewState Encryption in asp.net


Encrypting of the View State: You can enable view state encryption to make it more difficult for attackers and malicious users to directly read view state information. Though this adds processing overhead to the Web server, it supports in storing confidential information in view state. To configure view state encryption for an application does the following:

<Configuration>
         <system.web>
               <pages viewStateEncryptionMode="Always"/>
         </system.web>
</configuration>

Alternatively, you can enable view state encryption for a specific page by setting the value in the page directive, as the following sample demonstrates:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" ViewStateEncryptionMode="Always"%>

No comments:

Post a Comment

Comments

Search

Custom Search
Protected by Copyscape Plagiarism Software