Could someone help me.
After hitting the submit page how do get the text box to clear? The
page is posting back to itself. What do I put on the code behind page?
Mark Rae [MVP] - 30 Oct 2007 20:12 GMT
> After hitting the submit page how do get the text box to clear? The
> page is posting back to itself.
The submit page...?
> What do I put on the code behind page?
What are you trying to do exactly...?
Please clarify precisely what you mean...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
Scott M. - 30 Oct 2007 20:13 GMT
Just change the "EnableViewState" property of the Textbox to "False" in the
Properties Windows at design-time. No code necessary.
> Could someone help me.
>
> After hitting the submit page how do get the text box to clear? The
> page is posting back to itself. What do I put on the code behind page?
Patrice - 30 Oct 2007 20:17 GMT
IMO it won't work as persisting the texbox content is not done using
viewstate. By design field values are posted to a server (this is how an
HTML form works). The viewstate is there for any other property you could
have to maintain between postbacks except the textbox content).
Your best bet is to explicitelty set the value to an empty string in the
submit button event handler...
--
Patrice
> Just change the "EnableViewState" property of the Textbox to "False" in
> the Properties Windows at design-time. No code necessary.
[quoted text clipped - 3 lines]
>> After hitting the submit page how do get the text box to clear? The
>> page is posting back to itself. What do I put on the code behind page?
David Wier - 30 Oct 2007 20:37 GMT
Just add this to your code:
MyTextBox.text=""

Signature
David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
> Could someone help me.
>
> After hitting the submit page how do get the text box to clear? The
> page is posting back to itself. What do I put on the code behind page?
JJ297 - 31 Oct 2007 13:14 GMT
> Just add this to your code:
> MyTextBox.text=""
[quoted text clipped - 10 lines]
>
> - Show quoted text -
Thanks I added the text to my code and the box is now clear after
hitting the submit button.
JJ297 - 31 Oct 2007 13:14 GMT
> Just add this to your code:
> MyTextBox.text=""
[quoted text clipped - 10 lines]
>
> - Show quoted text -
Thanks it worked!