如何在asp.net中使整个div只读 [英] How to make the whole div readonly in asp.net

查看:180
本文介绍了如何在asp.net中使整个div只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让整个div只读(div中的所有控件都应该只读),它可能包含(textbox,images,dropdownlist..etc asp控件)使用javascript或jquery或c#代码或以其他方式,



任何人都可以帮助我...

请仅发布测试代码。

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.

推荐答案

谷歌为你打破?我得到2,220,000个结果



使用Javascript启用或禁用DIV标签及其内部控件 [ ^ ]



仅供参考,您不能期望为您的项目提供完美的代码,您必须对其进行自定义以便更好地使用。搜索,定制,测试和使用它
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


你好Hari,



默认情况下,DIV没有读写属性,也没有属性。所以,你可以创建一个div并将其放入其中,但是你不能让div'只读'。它不是默认的读取或写入,它只是其他内容的容器。

要使所有控件只读,请参阅链接 [ ^ ]。



希望这会对你有所帮助。



问候,

RK
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


您可以尝试添加一个asp:面板,而不是添加代码使div成为只读在div中,以便控件在面板内。将面板的Enabled属性设置为false,以便内部的所有控件都不可编辑。
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.


这篇关于如何在asp.net中使整个div只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆