ASP.NET validators don't do this automatically. The RequiredFieldValidator
only looks at a single textbox at a time.
I can offer two solutions:
1. Use the CustomValidator and write the logic yourself. On the server side,
its pretty easy. On the client-side, you have to know a bit about javascript
and DHTML.
2. I wrote a replacement to the ASP.NET validators that can easily handle
this. Professional Validation And More
(
http://www.peterblum.com/vam/home.aspx) includes 22 validators that work on
many more browsers. One validator is the MultiConditionValidator. Use it to
combine other validators and build AND/OR logic expressions. In your case,
you need two required validators combined with an OR statement: TextBox1 is
required or TextBox2 is required.
Even if you don't want a commercial solution, it helps to know the
limitations of ASP.NET validators so you can better plan your project. I put
together a list that I've found at
http://www.peterblum.com/vam/valmain.aspx.
--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx