Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to let user see the textbox value. but user can not change the value. For this I put the textbox property
Readonly=false. This has some problem such as when user click a textbox several times and press backspace
then it goes to the previous page. How can I ensure user not to enter any value in the textbox.Please give me a clear idea.
Thanks in advance.
Posted
Updated 17-Dec-14 19:08pm
v2
Comments
PIEBALDconsult 18-Dec-14 0:34am    
Did you have a question? Use Improve question.
santhu888 18-Dec-14 1:48am    
For your requirement,U have to put textbox property Readonly=True.
George Jonsson 18-Dec-14 2:03am    
If you only want to show a value, but no way to edit the value you could use a Label.
Sinisa Hajnal 18-Dec-14 2:30am    
ReadOnly = True and TabStop = false...it will not prevent the user from clicking it, but you could write javascript so that on focus it moves the focus elsewhere.

1 solution

you can set it to readonly and enabled to false:
TextBox1.Enabled = "false"
 
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