title: Validating an ASP.NET user control from its parent page
body: <p>I have an asp.net page with a button.  This button generates and inserts a user control into the page, so many controls could exist on one page. I need to validate that a certain dynamically generated control inside the generated control exists.  </p>
  
  <p>So..Page has 0 to N Control1’s.  Each Control 1 can have 0 to N Control2’s.  When SaveButton is clicked on Page, I need to make sure there are at least 1 Control2’s inside every Control1.  </p>
  
  <p>I’m currently between two options:</p>
  
  <p>•   Dynamically insert CustomValidators for each control that is generated, each of which would validate one Control1.</p>
  
  <p>•   Do the validation manually (with jQuery), calling a validation function from SaveButton.OnClientClick.</p>
  
  <p>Both are sloppy in their own way – which is why I’m sharing this with you all.  Am I missing the easy solution?</p>
  
  <p>Thanks in advance.. (btw – anything up to and including .NET 3.5 SP1 is fair game)</p>