HistoryIn our application we created a special (user friendly) window for showing messages to the user. The window will get its data, text, buttons through the args parameter.
We will open this window using the messageBox function (this method lies in one of our JS files).
ChallengeEveryone knows the annoying default alert of ValidationSummary in ASP.NET.Our messageBox still couldn't rid from the alert that the WebUIValidation.js is popping up on validation error.Why? Because in this JS, Microsoft simply write alert(msg).
SolutionToday we wrote those simple lines:window.alert = function specailAlert(msg) { messageBox("title", msg, button_ok, info_icon);}
This will cause the JS parser to call our function any time the origin window.alert is running. So from now on, when the ValidationSummary will write alert("some useful message"), our method will replace the ugly gray box with our user friendly window.
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.