How to get the value of built, encoded ViewState? *

Question

I need to grab the base64-encoded representation of the ViewState. Obviously this would not be available until fairly late in the request lifecycle, which is OK.

For example, if the output of the page includes:

<input type="hidden" name="__VIEWSTATE" 
  id="__VIEWSTATE" value="/wEPDwUJODU0Njc5MD...==" />

I need a way on the server side to get the value "/wEPDwUJODU0Njc5MD...=="

To clarify, I need this value when the page is being rendered, not on PostBack. e.g. I need to know the ViewState value that is being sent to the client, not the ViewState I'm getting back from them.

Answer

Rex, I suspect a good place to start looking is solutions that compress the ViewState -- they're grabbing ViewState on the server before it's sent down to the client and gzipping it. That's exactly where you want to be.

< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/1010/" >How to get the value of built, encoded ViewState?< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment