Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JJ297 - 30 Oct 2007 20:04 GMT
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!

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.