Click here to Skip to main content
15,923,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please help me in solving this problem
i am highly suffering from this my job is on risk regarding this problem

Thanks & Regards
shah md.
New Delhi
Posted
Comments
jerrykid 23-Jan-11 1:30am    
Do you mean on Page_Load event?

Set Enable property of the textBox to False on CheckedChanged() event of the checkbox as below.

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
textBox1.Enabled = false;
}
 
Share this answer
 
how to make textboxes noneditable when a checkbox is checked at runtime
Saini's answer is server side way to do it and would be avoided 99% times in todays world if with complete postback.

I would suggest you to do this enable/disable thing using Javascript. Attach a onchange event of checkbox to JS method and in that method, find the textbox and disable it.

OR

Other approach would be to use AJAX - UpdatePanel concept.

I hope since it's so urgent to you, based on my reply you would surely resolve it now! :)


i am highly suffering from this my job is on risk regarding this problem
BTW, Relax, no one can kick you out of job for such problem! :)
 
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