I seem to keep running into these complex show/hide scenarios in ASP.NET web forms where the logic goes "if Field A equals blah, and Field B equals blahblah, then Field C is shown/hidden/validated/whatever." Before I run off and start building custom validators and custom controls so I can more easily manage it in markup or backend code, are there any libraries or simpler solutions I'm missing out there in the wild? jQuery makes the job easier, but I get the feeling I could abstract a lot of what I'm wrangling with out into a more elegant solution.
All of the controls that are dependent on each other or could trigger events are my own custom controls already, so I get the feeling I could start writing a small framework to handle it like so:
<my:DynamicShowHide runat="server">
<PrerequisiteFields>
<PrerequisiteField ControlId="FieldA" Value="blah" />
<PrerequisiteField ControlId="FieldB" Value="blahblah" />
</PrerequisiteFields>
<DependentFields>
<DependentField ControlId="FieldC" />
</DependentFields>
</my:DynamicShowHide>
...that way if the Prerequisite values were both evaluated as true, the DependentField would show, and hide if not.
It seems (and feels) like I'm overengineering but I run into insanely large and complex decision trees like this more and more often. Anyone know of a better way or an existing library that does something along these lines?