I create a text field inside the repeater similar to this (so many text fields are created inside the loop and added to the repeater control)
.aspx.cs
TextBox textBox = new TextBox(); textBox.TextChanged += new EventHandler(textBox_TextChanged);
and I have a function like this to change the background color of the textBox to white if there is text in this text box (yellow when creating the form)
protected void textBox_TextChanged(object sender, EventArgs e) { TextBox textBox = sender as TextBox; if (textBox.Text != String.Empty) { textBox.BackColor = System.Drawing.Color.White; } }
but the function does not hit at all. Any pointers to what I'm doing wrong?
Thanks.
source share