Click here to Skip to main content
15,899,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 16-Feb-12 22:36pm

1 solution

Hey,

HTML has a couple of sttributes available to make controls uneditable. You can eitther make them read-only, or disable them.
HTML
<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!
 
Share this answer
 
Comments
Member 8654308 17-Feb-12 5:49am    
my problem is i have to make page eadonly for some user but for some user like admin it has to be in read write state.
Eduard Keilholz 17-Feb-12 6:06am    
Then check which user is logged in before you render the page and either make the fields read-only or not. There is no way to make an entire page read-only.

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