S
Sven Jacobs
Hello everybody!
Imagine a form with several TextBox WebControls and two buttons "New" which
should clear the form and "Save". On reloading or leaving the page which
holds the form the TextBoxes should be cleared so I've disabled the
ViewStates of these TextBoxes by setting the EnableViewState property to
false.
The method which is bound to the OnClick event of the "New" button is
empty. When clicked a PostBack occurs which, theoretically, should be
sufficient to clear the TextBoxes because their state shouldn't be saved.
Unfortunately after the PostBack the data is still there! I've had a look
into the HTML source and found out that the value property of the TextBoxes
is set, so there's still a ViewState?! Even a ViewState.Clear() and/or
ClearChildViewState() within OnClick() doesn't work!
Disabling the ViewState for the whole page is no solution because the page
also contains a DataGrid and other controls which depend on the ViewState.
Please help!
Imagine a form with several TextBox WebControls and two buttons "New" which
should clear the form and "Save". On reloading or leaving the page which
holds the form the TextBoxes should be cleared so I've disabled the
ViewStates of these TextBoxes by setting the EnableViewState property to
false.
The method which is bound to the OnClick event of the "New" button is
empty. When clicked a PostBack occurs which, theoretically, should be
sufficient to clear the TextBoxes because their state shouldn't be saved.
Unfortunately after the PostBack the data is still there! I've had a look
into the HTML source and found out that the value property of the TextBoxes
is set, so there's still a ViewState?! Even a ViewState.Clear() and/or
ClearChildViewState() within OnClick() doesn't work!
Disabling the ViewState for the whole page is no solution because the page
also contains a DataGrid and other controls which depend on the ViewState.
Please help!