•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,815 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,566 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 726 | Replies: 8
![]() |
•
•
Join Date: Dec 2007
Posts: 25
Reputation:
Rep Power: 1
Solved Threads: 0
hi every one,
i need some helpe on asp.net with c# components ,
i have some text boxs and labels i need to reset the textbos and labels' text to be empty when i click explorer back button i need to rest them to empty and when i click refresh button to reset them also to empty . put when i click button for example "save button" i do not need to reset them to empty if the page postback with errors or without errors because i have required fields need not to set to empty
please helpe me,
Many Thanks,
i need some helpe on asp.net with c# components ,
i have some text boxs and labels i need to reset the textbos and labels' text to be empty when i click explorer back button i need to rest them to empty and when i click refresh button to reset them also to empty . put when i click button for example "save button" i do not need to reset them to empty if the page postback with errors or without errors because i have required fields need not to set to empty
please helpe me,
Many Thanks,
•
•
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,123
Reputation:
Rep Power: 3
Solved Threads: 47
I am not quite sure I understand what you mean. is it that you need:
1.reset button to reset textboxes to ""
2.refresh button textboxes =""
3.back button tb = ""
?
1.reset button to reset textboxes to ""
2.refresh button textboxes =""
3.back button tb = ""
?
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
•
•
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,123
Reputation:
Rep Power: 3
Solved Threads: 47
in the event handler of the reset btn add for each textboxyou could try:
or something similar.
cannot remember exactly what the statement looks like but think its something like that
textbox1.SetText("");or something similar.
cannot remember exactly what the statement looks like but think its something like that
Last edited by majestic0110 : Mar 17th, 2008 at 9:10 am.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
•
•
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,123
Reputation:
Rep Power: 3
Solved Threads: 47
here we go this is what you need
textbox1.Text = "";
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
•
•
Join Date: Sep 2007
Posts: 1,054
Reputation:
Rep Power: 3
Solved Threads: 61
Best bet, is to do this:
1. Check to see if the page is a postback.
2. Within the event that was accessed (a button_click), set your textboxes.
If you do not set a value to these textboxes, they will be erased. However, if you do set a value, they should be set to the value you specified.
1. Check to see if the page is a postback.
2. Within the event that was accessed (a button_click), set your textboxes.
VB.NET Syntax (Toggle Plain Text)
<script type="vb"> Sub Page_Load .... .... End Sub Public Sub save_click() textbox1.Text = textbox1.Text textbox2.Text = textbox2.Text textbox3.Text = textbox3.Text End Sub </script>
Last edited by SheSaidImaPregy : Mar 17th, 2008 at 9:28 am.
•
•
Join Date: Oct 2007
Location: Bristol, UK
Posts: 1,123
Reputation:
Rep Power: 3
Solved Threads: 47
•
•
Join Date: Dec 2007
Posts: 25
Reputation:
Rep Power: 1
Solved Threads: 0
hi
you do not understand my question ,
i have build asp.net with c# web page this page supposed to send some information to Sql DB and then go directly to another web page when i do that it work will and go to the next page put when i go back to the past page i found that information i have sent to DB stell found on the page inside the textbox . the problem is i need to reset that text box and label text to empty as if i opend it for first time that does not happen if you can helpe me.
thanks alot
you do not understand my question ,
i have build asp.net with c# web page this page supposed to send some information to Sql DB and then go directly to another web page when i do that it work will and go to the next page put when i go back to the past page i found that information i have sent to DB stell found on the page inside the textbox . the problem is i need to reset that text box and label text to empty as if i opend it for first time that does not happen if you can helpe me.
thanks alot
Last edited by IT_Techno : Mar 18th, 2008 at 4:08 am.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
Similar Threads
- login page problem (ASP.NET)
- Hotmail Problem (OS X)
- Problem setting up router (Networking Hardware Configuration)
- Help With Printer Problem (Windows NT / 2000 / XP / 2003)
- IE resets home page to "about blank" upon exit (Viruses, Spyware and other Nasties)
- Temp internet files problem, pages load over each time (Viruses, Spyware and other Nasties)
- Network error unable to read url from host g.msn.com: connection reset by peer (Viruses, Spyware and other Nasties)
- Possible CWS problem (Viruses, Spyware and other Nasties)
- mshp.dll problems with home page & pop-ups (Viruses, Spyware and other Nasties)
Other Threads in the ASP.NET Forum
- Previous Thread: mailing
- Next Thread: Scalar variable Error



Linear Mode