An HttpModule that moves ViewState to the bottom(madskristensen.dk)

submitted by silverCOREsilverCORE(275) 5 years, 2 months ago

Mads Kristensen shows how to move the ViewState to the bottom of the page with a couple of advantages that this brings.

3 comments |category: |Views: 225

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by KinlanKinlan(150) 5 years, 2 months ago 0

I seem to remember that the reason why viewstate is at the top of the page, is because if the page posts back before it finishes rendering at least the internal state of the page on the server can restore it's state correctly. If you have the viewstate at the end of the page and it hasn't finished rendering (i.e the viewstate has not been rendered) before the screen posts back then you are up a certain creek without a paddle...

For that reason alone I would not recommend anyone use this method.

Reply

posted by silverCOREsilverCORE(275) 5 years, 2 months ago 0

Thanks for the observation Kinlan....never would've guessed that it could be a problem.

Reply

posted by gavinjoycegavinjoyce(25.7k) 5 years, 2 months ago 0

If ViewState (and ControlState) is used correctly, this should not be needed. People have problems with ViewState because they shove any old data in there, when normally just a dash of ControlState is really needed.

Reply

information Login or create an account to comment on this story