The other day I saw a code where the developer intended to check his code by displaying a message box in ASP.NET applicatoin if a condition is true, in order to accomplish this he refrenced the System.Windows.Forms assembly and called the MessageBox to display his message. When running the code, it actually worked !! and displayed the message successfully !!! I freezed when I saw this ! How come a windows form control message box is displayed on the browser ?! Actually it makes all the sense to be displayed from a technical point of view ... but it will create a disaster when its really used !!! what actually happens is that when the MessageBox is displayed the thread of the process is freezed until the User clicks ok !!!! and what user is that ... figured out the trick ?!!? Let me give an example : the application on server ABC and some user on machine xyz is browsing the application, now when he faces the condition and the message should be displayed it will not be displayed to XYZ User !!! it will be displayed on ABC server since its a server side call !!!! Now he had no clue about that because he was in development time on his machine, and his machine in debugging is the server as well, so he was able to see the message box with no problem :) It's a codding horror no doubt ... but it makes an asp.net developer thinks more realistic and deeper on the behaviour of his own applications !!!
Sincerely Samer Abu Rabie Imagination is more important than knowledge !
modified on Sunday, May 17, 2009 3:59 AM