title: Display alert message before Closing Modal window
body: <p>I am using ShowModalDialog to open the Dialog Window. While Closing i am displaying Message using alert('Submit Successfully').</p>
  
  <p>Problem is, Message is displaying in blank page.</p>
  
  <pre><code>function CloseWindow(Stat, msg) {
              alert(msg);
              window.returnValue = Stat;
              self.close();
          }
  </code></pre>
  
  <p>In codebehind,</p>
  
  <pre><code> Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "My", " CloseWindow('1','Submit Successfully');", true);
  </code></pre>