以可读状态打开网页

以可读状态打开网页

问题描述:


我的项目中有一个网页,其中包含各种控件,例如文本框,复选框,gridveiw等.这些控件已与数据库绑定,我想以只读模式打开该页面.请告诉我如何以只读方式显示该网页状态,以便可以看到其内容但不能编辑任何内容.

谢谢

Hi,
I have a web page in my project which is having various contols like textbox, check box, gridveiw etc. which are binded with database i want to open that page in read only mode.please tell me how to show a web page in read only state so that one can see its content but could not edit any thing.

Thanks

嘿,

HTML有一些可用于使控件不可编辑的特性.您可以将它们设置为只读或禁用它们.
Hey,

HTML has a couple of sttributes available to make controls uneditable. You can eitther make them read-only, or disable them.
<input type="text" name="address" value="123th First Street" readonly="readonly" />


或禁用文本框:


Or to disable the textbox :

<input type="text" name="address" value="123th First Street" disabled="disabled" />



对我自己来说,我喜欢禁用控件而不是将它们设置为只读,因为在各种设备上,这种区别更加明显,但是当然这是您的选择.

祝你好运!



For myself, i like to disabled controls in stead of making them read-only because the difference is more obvious on various devices, but ofcourse this choise is yours.

Good luck!