p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspx thread: TextBox in Web Forms


Message #1 by Terrence Joubert <Terrence@v...> on Wed, 17 Jul 2002 11:42:56 +0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C22D65.911A1DE0
Content-Type: text/plain

Hi,
 
I have a TextBox control on a web form. The control's Text property is set
on the first load of the page to something like 'My first text '. One the
client, the user can change the text in the TextBox. However, when the page
post back to the server, the user's data is lost and the value of the Text
property is still the original value - 'My first text ' instead of the value
entered by the user.
 
Is this supposed to be the case or is the Text property supposed to change
to the input by the user? 
If what I am experiencing is 'normal', then does anyone has a workaround?
 
Thanks
Terrence
 

Message #2 by Pavankumar T <PavanKumar.T@k...> on Wed, 17 Jul 2002 14:26:29 +0530
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C22D6F.D72B8AD0
Content-Type: text/plain;
	charset="iso-8859-1"

Try this !!!
 
In page_load function do like this.
If Not (IsPostBack) Then
textbox.text="My first text"
end if
After this you can change the textbox value to any thing and submit, your
changed value will be stored.
 
 
-----Original Message-----
From: Terrence Joubert [mailto:Terrence@v...]
Sent: Wednesday, July 17, 2002 1:13 PM
To: ASP+
Subject: [aspx] TextBox in Web Forms
Importance: High


Hi,
 
I have a TextBox control on a web form. The control's Text property is set
on the first load of the page to something like 'My first text '. One the
client, the user can change the text in the TextBox. However, when the page
post back to the server, the user's data is lost and the value of the Text
property is still the original value - 'My first text ' instead of the value
entered by the user.
 
Is this supposed to be the case or is the Text property supposed to change
to the input by the user? 
If what I am experiencing is 'normal', then does anyone has a workaround?
 
Thanks
Terrence
 
--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to  

Message #3 by Terrence Joubert <Terrence@v...> on Wed, 17 Jul 2002 12:51:17 +0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C22D6F.1D5F8E70
Content-Type: text/plain

Thanks. I tried that, it worked. What I notice is that all assignments to
the Text property on the server in ASP .NET code works fine. But, the input
that the user enters on the client does not get stored.
 
Thanks
Terrence
 
-----Original Message-----
From: Pavankumar T [mailto:PavanKumar.T@k...] 
Sent: Wednesday, July 17, 2002 12:56 PM
To: ASP+
Subject: [aspx] RE: TextBox in Web Forms
 
Try this !!!
 
In page_load function do like this.
If Not (IsPostBack) Then
textbox.text="My first text"
end if
After this you can change the textbox value to any thing and submit, your
changed value will be stored.
 
 
-----Original Message-----
From: Terrence Joubert [mailto:Terrence@v...]
Sent: Wednesday, July 17, 2002 1:13 PM
To: ASP+
Subject: [aspx] TextBox in Web Forms
Importance: High
Hi,
 
I have a TextBox control on a web form. The control's Text property is set
on the first load of the page to something like 'My first text '. One the
client, the user can change the text in the TextBox. However, when the page
post back to the server, the user's data is lost and the value of the Text
property is still the original value - 'My first text ' instead of the value
entered by the user.
 
Is this supposed to be the case or is the Text property supposed to change
to the input by the user? 
If what I am experiencing is 'normal', then does anyone has a workaround?
 
Thanks
Terrence
 
--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to  
--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to  

Message #4 by Feduke Cntr Charles R <FedukeCR@m...> on Wed, 17 Jul 2002 10:22:45 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C22D9D.6B6E6EB0
Content-Type: text/plain;
	charset="ISO-8859-1"

Yes, "IsPostBack" is a public member of the Page class that determines if
the page is posting data back to itself and is useful for determining when
to use default values.  ViewState data and PostBack data is read and
interpreted *before* the Page_Load event fires, so you text boxes are
getting their data, then Page_Load fires which causes the text box's value
to be changed to what you have specified as the default.
 
- Chuck
-----Original Message-----
From: Pavankumar T [mailto:PavanKumar.T@k...]
Sent: Wednesday, July 17, 2002 4:56 AM
To: ASP+
Subject: [aspx] RE: TextBox in Web Forms


Try this !!!
 
In page_load function do like this.
If Not (IsPostBack) Then
textbox.text="My first text"
end if
After this you can change the textbox value to any thing and submit, your
changed value will be stored.
 
 
-----Original Message-----
From: Terrence Joubert [mailto:Terrence@v...]
Sent: Wednesday, July 17, 2002 1:13 PM
To: ASP+
Subject: [aspx] TextBox in Web Forms
Importance: High


Hi,
 
I have a TextBox control on a web form. The control's Text property is set
on the first load of the page to something like 'My first text '. One the
client, the user can change the text in the TextBox. However, when the page
post back to the server, the user's data is lost and the value of the Text
property is still the original value - 'My first text ' instead of the value
entered by the user.
 
Is this supposed to be the case or is the Text property supposed to change
to the input by the user? 
If what I am experiencing is 'normal', then does anyone has a workaround?
 
Thanks
Terrence
 
--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to  
--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to  


  Return to Index