Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Frnds,
I have form with Multiple textboxes.when i clicking button its getting clear.entered text getting clear.

Thanks
Suresh
Posted
Comments
[no name] 27-Sep-13 11:08am    
Probably getting clear because of a postback
itsureshuk 27-Sep-13 11:22am    
How to overcome this problem
ridoy 27-Sep-13 13:22pm    
show us your code,otherwise hard to help you.

Comment out everything in the load/init event. Try it again then correct whatever errors you are committing there. Also, check if there are any explicit resetting of the textbox contents.

Put any code in side your load/init event within the If Not PostBack block. If not, you may reset your textbox if you have put code there to initialize the textbox(es).

I hope this helps
 
Share this answer
 
v2
Comments
itsureshuk 27-Sep-13 11:06am    
load and init event what i have to do?...Can you explain me.
If you have a fix value and any other entire value and you have to not clear your textbox when clicking on button click event then another way is to use client side state management technique by using ViewState. So, first store the entire value in viewstate and after executing load/init event you can also set and use the value of viewstate to textbox.
 
Share this answer
 
There must be some Java Script kind of this doing this. Plz check your script file.
 
Share this answer
 
Comments
itsureshuk 4-Jan-14 7:34am    
I commented javascript validation and executed , now it is working fine. In c# page i am getting textbox value . Now i again uncommented the javascript , now also working i am getting textbox value...Actucally what is the reason for automatically clearing textbox?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900