Posted on: 4/13/2014 5:44:39 AM | Views : 513

Hi

Say I have some code that is called OnChange (or some other event).
For example, this will look to see if DDLMyDiv (plus a number) has a value of "Enable text box". If it doesn't that a text box TxTMyDiv (plus a number) will be disabled.

protected void EnDisMyBox(object sender, EventArgs e) { var ddl = (DropDownList)sender; var digit = ddl.ID.Replace("DDLMyDiv", string.Empty); var textBox = (TextBox)Page.FindControl("TxTMyDiv" + digit); textBox.Enabled = ddl.SelectedValue == "Enable text box"; } </script> This is fine on a small form.  But on a large form it slows down the whole page as it checks every dropdown called DDLMyDiv (plus a number).
Is there a way to have the call made just on the Div that is comes from?
So, if you click DDLMyD ...

Go to the complete details ...