I tend to group TextChanged events like this as an example.
protected void TextChangedEvents(object sender, EventArgs e) {
if (sender == txt1) {
string strTest1 = txt1.Text));
}
else if (sender == txt2) {
string strTest2 = txt2.Text));
}
}
If I don't have very many on a form, I use the standard procedure as follows: protected void txt1_TextChanged(object sender, EventArgs e) {
string strTest1 = txt1.Text;
}
In the first one where they are combined, I just show a very simple example. If the subroutine is complex anda lot of repetitions, it saves on the size of the code behind file. But is it an ok way to do it. It seems theoretically that having an individual procedure for each control would end up being faster, but the file would be smaller. I assume it would be negligible but am curious as to what others think.