Solved

How to prevent Literal and Textbox control repopulating?

Posted on 2006-07-18
6
497 Views
Last Modified: 2010-03-19
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
0
Comment
Question by:WillyCornbread
  • 2
  • 2
6 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17139121
>>with no postback check.
Why aren't you checking Page.IsPostBack before setting value?

Bob
0
 

Author Comment

by:WillyCornbread
ID: 17139219
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17139389
Well, I can't see any answer from what you described.

Bob
0
 

Accepted Solution

by:
WillyCornbread earned 0 total points
ID: 17139491
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

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question