Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

17
  • 1
    What do you call "data"? Text on the label and on the textbox? If so, how is this text set, in the markup? Commented Nov 10, 2016 at 11:45
  • @Andrei On the button click I write this TextBox1.Text = "Changed"; Label1.Text = "Changed."; and I expect the label loses it's data because I disable viewstate and it doesn't implement IPostBackDataHandler. Commented Nov 10, 2016 at 11:47
  • Ok, it is clear what you mean by data but not what you mean by "loses". So you change text on click. Now what do you expect? Page loads and the control has value other than "Changed"? Or next postback occurs and control has value other than "Changed"? Commented Nov 10, 2016 at 11:52
  • @Andrei What is the usage of EnableViewState="False"? Shouldn't by disabling it I lose the changed data after postbacks? It's clear why EnableViewState="False" is not working for Textbox but I'm wondering why it's not working for label too? Commented Nov 10, 2016 at 11:55
  • What text you are getting on label? Commented Nov 10, 2016 at 12:02