Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

ASP.NET - Decoding viewstate is very simple by using LosFormatter class

Jan 15 2012 11:24PM by Ramireddy   

Though I know viewstate is vulnerable to security as it reveals sensitive information, I always thought that its reasonably difficult to decode. But i found that decoding viewstate is very much simpler. ASP.NET has a class "LosFormatter", by using which we can decode viewstate

        LosFormatter objFormatter = new LosFormatter();
        object obj = objFormatter.Deserialize("/wEPDwUKMTY1NDU2MTA1Mg8WAh4IVXNlck5hbWUFA3JhbWRkDvYzPkcPmjxL5DxLYraiJbrD7wqe9bYTDBb3lW5yxhQ=");

See the "obj" properties in watch window and you can simply find that it's a collection of pairs and you can see the values you stored in viewstate in plain text.

Read More..   [32134 clicks]

Published under: Microsoft .NET Tips ·  ·  ·  · 

3 · 40% · 12972



  • Really good post Rami,

    Also I want add cons of LosFormatter. Whan I was working on viewstate compression to improve page performance, LosFormatter gave negative results(while measuring with profiler). Then we came to know Seialize and Deserialize steps eats time if viewstate object is large, also as it is saving as Base64 string it would increases the page size. It will a great choice if viewstate object is small in size.

    commented on Jan 16 2012 9:58AM
    Robert Dennyson
    11 · 14% · 4430
  • Thanks Robert for feedback..

    But its not disadvantage of LosFormatter. As viewstate is carried out with webpage, it will add to page size, which affects performance. There is no role for LosFormatter in affecting performance. LosFormatter is to serialize/deserialize the viewstate.

    commented on Jan 16 2012 11:29AM
    3 · 40% · 12972

Your Comment

Sign Up or Login to post a comment.

"ASP.NET - Decoding viewstate is very simple by using LosFormatter class" rated 5 out of 5 by 13 readers
ASP.NET - Decoding viewstate is very simple by using LosFormatter class , 5.0 out of 5 based on 13 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]