Encrypt That ViewState!

Something that is probably over looked from time to time unless you are just always that secure is encrypting your ViewState.  While SSL may prevent some things you will may want to make it a bit harder for an end user to see the information stored in ViewState.

Luckily this is very simple.  You can set it in the @Page directive (<%@ Page Language=”C#” ViewStateEncryptionMode=”Always” %>) or in the web.config file (<pages viewStateEncryptionMode=”Always” />).

Of course, like many things .NET there are many ways to do this depending on your specific situation.  For that amount of detail you should read the ViewState Overview.

Advertisements

About SheldonS

Web developer for over 15 years mainly with Microsoft technologies from classic ASP to .NET 4. Husband, father, and aspiring amateur photographer.

Posted on January 11, 2012, in .NET and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: