Reputation: 11
I have a master page that contains two other child pages. It's a web page with a couple tabs contained on it. Each tab has a number of controls inside.
The issue I am having is when a textBox value changes in the first tab, I want it to clear out the text box on the other tab. When the text changes in the textbox in the first tab, it fires an on text changed event.
Inside that event, I find the control on the other tab, and while debugging I can see the value that is currently stored in it. I use otherTabTextbox.Text = ""
to set the value to be empty and let the post back finish, but when I click to change tabs, the previous value is still in the text box. Any thoughts?
Upvotes: 0
Views: 339
Reputation: 3181
You can use FinControl method:
var textBox1 = tab1.FindControl("TextBox1") as TextBox;
textBox1.Text = null;
If it's not working I guess u have multiple UpdatePanels?
Upvotes: 1