Solved

How to prevent Literal and Textbox control repopulating?

Posted on 2006-07-18
6
486 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now