Say you have an ASP.NET page that lists the prices for certain items in labels. I know it's cringe-worthy, but say you took the price of the item from the label on the page to determine what the user is charged for their order. Does ASP.NET guarantee in any way that the text in those labels has not been tampered with?

1 Answer 1


Viewstate is what you're looking for.

It secures the page cryptographically, although it has known limitations that are located elsewhere on this site.

An optional MAC should be enabled for sensitive pages, such as yours, that allows the client to post back prices that are used by the business layer.

  • Controls that store values that go through viewstate would be protected, BUT if the control doesn't actually use viewstate for persistence then you're in trouble. It would be worth investigating if Label controls use viewstate.
    – Steve
    Jul 8, 2014 at 20:31
  • Can't you just set the viewstate property for that label control? Dec 10, 2015 at 22:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .