Text box

  • Thread starter Thread starter JJ297
  • Start date Start date
J

JJ297

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?
 
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...
 
Just change the "EnableViewState" property of the Textbox to "False" in the
Properties Windows at design-time. No code necessary.
 
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...
 
Just add this to your code:
MyTextBox.text=""

--

David Wierhttp://aspnet101.comhttp://iWritePro.com- One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup







- Show quoted text -

Thanks I added the text to my code and the box is now clear after
hitting the submit button.
 
Just add this to your code:
MyTextBox.text=""

--

David Wierhttp://aspnet101.comhttp://iWritePro.com- One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup







- Show quoted text -

Thanks it worked!
 
Back
Top