andrew Sullivan
andrew Sullivan

Reputation: 4084

viewstate and textbox in asp.net

How is a TextBox able to persist changes (e.g. text) even after the EnableViewState property is set to false in ASP.NET?

Upvotes: 3

Views: 523

Answers (1)

Jamie Ide
Jamie Ide

Reputation: 49261

Because the ASP.NET Textbox control generates an HTML form input element <input type="text" name="x" />. You can verify this by looking at the source view from your browser on an ASP.NET page. When the form is posted, ASP.NET is able to read the text value from the HTTP POST contents. You can read more about it here and here.

Upvotes: 3

Related Questions