Restricting the user from leaving certain fields blank is often mandatory, because we don't want to have empty fields in our database, or we may want the user to specify exactly how many products he wishes to order. Asp.net comes in really good here with the Validation Controls. For my example the RequiredFieldValidator is perfectly suited because it displays a little error message for the control it validates.
All is fine until you have 40-50 fields that have to be filled out. In this case it's of good practice to use the ValidatioSummary control which summarises all the error messages from the ValidationGroup and shows them either in text on the page or as a Javascript alert().
All is fine again until you use the ValidationSummary inside an UpdatePanel, where something rather interesting happens. The alert box is displayed multiple times. When I got this behaviour it was even more interesting that the number of times the alert box is displayed was not constant. Many readers will immediately tell me that Microsoft admits that Validation Controls don't work well with the Asp.net AJAX UpdatePanel. Furthermore other readers will tell me that there is a certain validators.dll out there, and by defining some TagMappings in the web.config file all UpdatePanel Validation controversies will be solved. And yes sir, this is all true, but this still won't solve the ValidationSummary multiple alert() situation in the UpdatePanel.
Later I've noticed that there is a correlation between the number of times the alert is displayed and the number of asynchronous postbacks in that UpdatePanel. Yes, the ValidationSummary alert() is displayed exactly the number of asychronous postbacks times plus one. (0 postbacks --> 1 alert, 2 postbacks ---> 3 alerts)
To avoid this behaviour you only have to place the ValidationSummary outside the UpdatePanel, this will prevent it from reregistering itself for validation on each asynchronous postback.