What does the __VIEWSTATE hold?

前端 未结 6 1659
梦谈多话
梦谈多话 2020-12-06 10:34

I\'m sorry for maybe making such a basic question but in ASP.NET websites what does the __VIEWSTATE input field represent?

Also, is there any way to compute it\'s va

相关标签:
6条回答
  • 2020-12-06 10:58

    If you really want to understand it well, see Dave Reed's article about ViewState.

    0 讨论(0)
  • 2020-12-06 11:11

    What do you mean by compute it's value?

    Assume that it is a compressed (actually Base64 encoded) pair of your form fields/values in text form, which gets serialized into server side objects for you to work with.

    0 讨论(0)
  • 2020-12-06 11:16

    Paul Wilson has a very good article: ViewState: All You Wanted to Know

    VIEWSTATE can be deserialized with the LosFormatter class.

    0 讨论(0)
  • 2020-12-06 11:16

    A quick Google search answers the question:

    http://msdn.microsoft.com/en-us/library/ms972976.aspx

    First sentence:

    Microsoft® ASP.NET view state, in a nutshell, is the technique used by an ASP.NET Web page to persist changes to the state of a Web Form across postbacks.

    0 讨论(0)
  • 2020-12-06 11:17

    The easiest way of doing this in Razor is putting this on a view:

    @{
        throw new Exception();
    } 
    
    0 讨论(0)
  • 2020-12-06 11:24

    Do take a look at the biter script posted at http://forums.techarena.in/windows-software/1329157.htm.

    That script shows how to set up and use __ViewState and other .NET variables.

    That script logs into a .NET site, and gets stock values, without going thru a browser. Instead of user doing it manually, the script does it programmatically.

    0 讨论(0)
提交回复
热议问题