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
WillyCornbreadAsked:
Who is Participating?
 
WillyCornbreadConnect With a Mentor Author Commented:
After some further researd, I believe my problem is that the Page_load is handled PRIOR to any post-back events, so my data is not being changed until after the literal content is built.

I'll close this question.

b
0
 
Bob LearnedCommented:
>>with no postback check.
Why aren't you checking Page.IsPostBack before setting value?

Bob
0
 
WillyCornbreadAuthor Commented:
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
0
 
Bob LearnedCommented:
Well, I can't see any answer from what you described.

Bob
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.