WillyCornbread
asked on
How to prevent Literal and Textbox control repopulating?
Hi,
I have a literal and a textbox on my form, the contents of the literal are set in the Page_load with no postback check. Viewstate has been disabled for both controls, yet when a postback is performed, the textbox retains it's pre-post value, and so does the literal control. ( I know that viewstate doesn't hold the textbox value, blah blah blah)
I could handle the textbox by setting it's text to "" on postback, but the literal control SHOULD be refreshing itself each postback.
How can I make the page behave as it does when first loaded?
Thanks for your time,
b
I have a literal and a textbox on my form, the contents of the literal are set in the Page_load with no postback check. Viewstate has been disabled for both controls, yet when a postback is performed, the textbox retains it's pre-post value, and so does the literal control. ( I know that viewstate doesn't hold the textbox value, blah blah blah)
I could handle the textbox by setting it's text to "" on postback, but the literal control SHOULD be refreshing itself each postback.
How can I make the page behave as it does when first loaded?
Thanks for your time,
b
ASKER
I'm not checking, because I WANT to rebuild the literal regardless of whether the page was posted back, or the first access.
Thanks,
b
Thanks,
b
Well, I can't see any answer from what you described.
Bob
Bob
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Why aren't you checking Page.IsPostBack before setting value?
Bob