Exitos
Exitos

Reputation: 29720

Why asp.net textbox isnt storing state over postbacks?

Ive got some textboxes on a page and they are declared like this:

<asp:TextBox ID="tbVerbalyAgreed" ViewStateMode="Enabled" CssClass="datepickerTarget" runat="server"></asp:TextBox>

But when I post the page back the contents are clearing out which is annoying because I have cleary set the ViewState to on. Anyone know why this is?

Upvotes: 0

Views: 207

Answers (1)

James Johnson
James Johnson

Reputation: 46047

I would try removing ViewStateMode="Enabled" from the inputs and let them use the default settings.

I would also check to make sure that ViewState is enabled in the web.config, and make sure that you don't have any containers (Panel, PlaceHolder, etc.) around the controls with EnableViewState set to false. - thanks @Uwe Keim

Upvotes: 1

Related Questions