Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Just a MessageBox :S [modified]

Just a MessageBox :S [modified]

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharpasp-netsysadminhelptutorial
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Samer Aburabie
    wrote on last edited by
    #1

    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

    P J J B 4 Replies Last reply
    0
    • S Samer Aburabie

      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

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Samer Abu Rabie wrote:

      asp.net

      You should have said that up front.

      1 Reply Last reply
      0
      • S Samer Aburabie

        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

        J Offline
        J Offline
        Jeroen De Dauw
        wrote on last edited by
        #3

        That's a multi threaded fail process alright :D

        GSoC 2009 student for SMW! --- My little forums: http://code.bn2vs.com --- 70 72 6F 67 72 61 6D 6D 69 6E 67 20 34 20 6C 69 66 65!

        1 Reply Last reply
        0
        • S Samer Aburabie

          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

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          You'd be amazed how many people writing asp.net code actually do not understand how/where it runs.

          1 Reply Last reply
          0
          • S Samer Aburabie

            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

            B Offline
            B Offline
            BillW33
            wrote on last edited by
            #5

            If it is intended for use in production code it is a real horror. If it is just a diagnostic messagebox that will be removed for production code then it is not too bad; the programmer has to be sure to remove it though ;)

            Just because the code works, it doesn't mean that it is good code.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups