开发者

Disabling a user control or making it readonly in asp.net

I am using user controls to display some content on a asp.net page.And I need to disable(not invisible) a user control on the page depending on some conditions.

Instead of disabling each control inside the user control separately,is it possible to disable the user control itself?

I read some posts which mentioned of a property 'Enabled' for a user control.But I do not see that property for the user control in the intellisense.

Please could someone help me with this?

Thanks.

Edit: Instead of disabling the user control is it possible to set it to read only, as the user control values are not posted back if开发者_开发问答 it is disabled? Sorry about the confusion.


You could place all the seperate controls in a Panel inside the User control and then just disable that panel.

Then just add a method or property in the User Control that hides the disabling(i.e. disabling the panel) from the web page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜