Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to decode viewstate

I need to see the contents of the viewstate of an asp.net page. I looked for a viewstate decoder, found Fridz Onion's ViewState Decoder but it asks for the url of a page to get its viewstate. Since my viewstate is formed after a postback and comes as a result of an operation in an update panel, I cannot provide a url. I need to copy & paste the viewstate string and see what's inside. Is there a tool or a website exist that can help viewing the contents of viewstate?

like image 898
Serhat Ozgel Avatar asked Aug 22 '08 16:08

Serhat Ozgel


People also ask

How do I encode ViewState?

ViewState is base64-encoded. It is not encrypted but it can be encrypted by setting EnableViewStatMAC=”true” & setting the machineKey validation type to 3DES. If you want to NOT maintain the ViewState, include the directive < %@ Page EnableViewState="false" % > at the top of an .

What is ViewState used for?

View state is used automatically by the ASP.NET page framework to persist information that must be preserved between postbacks. This information includes any non-default values of controls. You can also use view state to store application data that is specific to a page.

What is ViewState generator?

The ViewState is basically generated by the server and is sent back to the client in the form of a hidden form field “_VIEWSTATE” for “POST” action requests. The client then sends it to the server when the POST action is performed from the web applications.


2 Answers

Here's an online ViewState decoder:

http://ignatu.co.uk/ViewStateDecoder.aspx

Edit: Unfortunatey, the above link is dead - here's another ViewState decoder (from the comments):

http://viewstatedecoder.azurewebsites.net/

like image 115
James Avatar answered Sep 20 '22 20:09

James


Use Fiddler and grab the view state in the response and paste it into the bottom left text box then decode.

like image 22
Darren Kopp Avatar answered Sep 20 '22 20:09

Darren Kopp