Friday, March 27, 2009

RequiredFieldValidator + AJAX TabContainer = mild frustration

I ran into a bit of trouble yesterday, but was finally able to decipher the problem and get my app working right today. Here's my set up: I have a page with an AJAX TabContainer (it has two tabs). On one tab there is a TextBox, a Button and a RequiredFieldValidator. The problems began when I added a TexBox and Button to Tab 2. When I click the button on Tab 2 the button_click event wouldn't fire, wouldn't fire, wouldn't fire. I was at a loss. So after systematically removing controls from each tab - I was able to narrow the issue down to the RequiredFieldValidator on Tab 1. So I googled "ajax tabcontainer required field validator" and found this post that really helped a lot and actually ended up making perfect sense. Add a ValidationGroup! Makes PERFECT SENSE!