Click here to Skip to main content
16,011,754 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to make the entire div readonly(all the controls inside div should be readonly),it may contain (textbox,images,dropdownlist..etc asp controls) using javascript or jquery or c# code or in someother way,

can anyone help me in this..
please post the tested code only.
Posted
Updated 27-Nov-13 1:44am
v3

Google broken for you? I got 2,220,000 results

Enable or disable DIV tag and its inner controls using Javascript[^]

FYI, you can't expect perfect code for your projects, you'll have to customize it for better use. Search, customize, test & use it
 
Share this answer
 
Hi Hari,

A DIV has no read or write property, and no properties at all, by default. So, you can create a div and put things in it, but you can't make the div 'read only'. It's not read or write by default, it's just a container for other content.
To make all controls readonly refer this link[^].

Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
Instead of adding code to make the div a read only, you can try add a asp:panel in the div so that the controls are within the panel. Make Enabled property of the panel to false so that all the controls inside are not editable.
 
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