Solved

How to prevent Literal and Textbox control repopulating?

Posted on 2006-07-18
6
516 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

690 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