title: After clicking ok button, do page redirect
body: <p>below is my WebMsgBox class. I use it to print some message.</p>
  
  <pre><code>using System;
  using Microsoft.VisualBasic;
  using System.Text;
  using System.Collections;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  /// &lt;summary&gt;
  /// Summary description for WebMsgBox
  /// &lt;/summary&gt;
  
  public class WebMsgBox
  {
  
      protected static Hashtable handlerPages = new Hashtable();
  
      private WebMsgBox()
      {
  
      }
  
  
  
      public static void Show(string Message)
      {
  
          if (!(handlerPages.Contains(HttpContext.Current.Handler)))
          {
  
              Page currentPage = (Page)HttpContext.Current.Handler;
  
              if (!((currentPage == null)))
              {
  
                  Queue messageQueue = new Queue();
  
                  messageQueue.Enqueue(Message);
  
                  handlerPages.Add(HttpContext.Current.Handler, messageQueue);
  
                  currentPage.Unload += new EventHandler(CurrentPageUnload);
  
              }
  
          }
  
          else
          {
  
              Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler]));
  
              queue.Enqueue(Message);
  
          }
  
      }
  
  
  
      private static void CurrentPageUnload(object sender, EventArgs e)
      {
  
          Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler]));
  
          if (queue != null)
          {
  
              StringBuilder builder = new StringBuilder();
  
              int iMsgCount = queue.Count;
  
              builder.Append("&lt;script language='javascript'&gt;");
  
              string sMsg;
  
              while ((iMsgCount &gt; 0))
              {
  
                  iMsgCount = iMsgCount - 1;
  
                  sMsg = System.Convert.ToString(queue.Dequeue());
  
                  sMsg = sMsg.Replace("\"", "'");
  
                  builder.Append("alert( \"" + sMsg + "\" );");
  
              }
  
              builder.Append("&lt;/script&gt;");
  
              handlerPages.Remove(HttpContext.Current.Handler);
  
              HttpContext.Current.Response.Write(builder.ToString());
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>when I use this class's method Show like below</p>
  
  <pre><code>WebMsgBox.Show("some message");
  </code></pre>
  
  <p>it works fine but when I do somthing like below</p>
  
  <pre><code>WebMsgBox.Show("some message");
  Response.Redirect("myform.aspx");
  </code></pre>
  
  <p>then it doesn't show the message. I need it like when this code executes, first it show the message and after when I click the ok button (which is on the message box), then it should redirects to the myform.aspx.</p>
  
  <p><em>I don't want to change, this class's code, B'Cos I use this class for many forms, I can't change this class's code just for one form.</em></p>
  
  <p>How can I do that.</p>