I have this method on my codebehind .cs file (.NET.Framework 4.0):
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
this.nombre.Enabled = false;
}
}
So, with this I can disable that nombre TextBox in my aspx, everytime when I click on the checkbox.
Here's the code in aspx file:
<asp:CheckBox ID="CheckBox1" Checked="false" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="true"/>
Now, I want to know, a way to simplify this routine, I mean, I have plenty of textboxes, radiobuttons, etc...
So how can I achieve this using a loop in asp.net?
Thanks in advance!