Click here to Skip to main content
15,748,559 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,How we can disable background when 'panel' get active; Because I am using panel as a validator
Herman<T>.Instance 31-Jan-12 4:48am    
What have you tried? Please show your code so we can see sharp what your trouble is.

1 solution

if you just want to disable every other control on page accept panel control than you can use following code

protected void DisableControls(Control parent)
foreach(Control c in parent.Controls)
if (c is DropDownList)
((DropDownList)(c)).Enabled = false;
elseif (c is TextBox)
((TextBox)(c).Enabled = false;
// similarly any other control type that you want to disable

here parent will be your page name or any other control that holds all the controls
Share this answer
Nimisha Mary John 31-Jan-12 6:33am    
thank you

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