Textbox属性只读问题

Textbox属性只读问题

问题描述:

我想让用户看到文本框值。但用户无法更改该值。为此,我把文本框属性

Readonly = false。这有一些问题,例如当用户多次单击文本框并按退格键

然后它转到上一页。如何确保用户不要在文本框中输入任何值。请给我一个清晰的想法。

提前谢谢。

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.

你可以将它设置为readonly并启用为false:

TextBox1.Enabled =false
you can set it to readonly and enabled to false:
TextBox1.Enabled = "false"