Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello ,

I want to know that can i use textbox(which will be hidden) to maintain the value between postbacks instead of viewstate as viewstate reduses performance so plz let me know which will be better for performance.
- viewstate or textbox(which will be hidden).

plz plz reply

Thanx in advance .
Satish Hirpara.
Posted

Actually the viewstate property store the data in Base 64 format in by default. but the textbox will store the text as plain text. Its easy to hack if you u store the value in the hidden textfield. Some times its depends on your requirement. For better suggestion we need how you are going to use.

Cool , Be simple ...its viewstate.
 
Share this answer
 
Comments
satish hirpara 24-May-13 8:22am    
Ok thats fine but i heard that viewstate reduses performance so wt abt that?
There is a concept of hiddenfield also,so theres no need to use hidden textbox.You can also make use of session.It wont make load on your page.

You can have very brief and informational article regarding sessions on below link

Exploring Session in ASP.NET[^]
 
Share this answer
 
v2
You can use hidden filed or view state both are same store on client side as base 64 and not secure.
If you want it secure then store as session variable.
It is make little load on you server as session is manage server side.
 
Share this answer
 
v2
Thank you all for your help ..!!!
 
Share this answer
 

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