*Experts* Bucky Posted August 23, 2002 *Experts* Posted August 23, 2002 I have a web form with two asp:TexBox controls, txtSubject and txtMessage, and txtMessage is multilined. If, in Page_Load, I set the Text property of either of these boxes, no matter what the user enters, the Text property always returns what was set in Page_Load. If I don't set a value for a box in Page_Load, the Text property retrieves the "correct" value. What am I missing here? :confused: Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
*Gurus* Thinker Posted August 23, 2002 *Gurus* Posted August 23, 2002 Is what you are describing at all similar to what is being described here... http://www.visualbasicforum.com/t33770.html Quote Posting Guidelines
*Experts* Bucky Posted August 23, 2002 Author *Experts* Posted August 23, 2002 (edited) Yes, the problem is a bit similar, only I am changing the textbox values in the code-behind file in Page_Load, not in JavaScript. I tried setting EnableViewState for both the boxes and the web form to False, but the same problem still occurs. And LOL at that thread title. :) [edit]Another thing if it helps... the TextChanged event does not seem to fire on either of the boxes, whether they end up returning the correct value or not[/edit] Edited August 23, 2002 by Bucky Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
*Experts* Bucky Posted November 19, 2002 Author *Experts* Posted November 19, 2002 Boy I feel dumb... Now that I understand ASP.NET concepts much more, I just recently looked back at that project and realized I was changing the Textbox's text in the Page's Load event without checking to see if IsPostBack was false first. When I hit the button, the Load event would fire, changing the text back to what it was originally, and then of course when the code came to handle the text in the button's Click event, the text was not what the user typed in. Thanks anyway for your help, Thinker. :) Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.