title: Code executes even after Response.End()
body: <p>I have to reload my page after I write some html, script to my page using Response.Write. After using Response.Write I am using Response.Flush(), followed by Response.End(). The code works properly in one server and when I deploy it to another server it is not working. 
  As far as I know the code execution must stop once it executes the Response.End, but it is now behaving in the desired way.</p>
  
  <pre><code>Response.ClearContent();
     Response.Write("Write some html, script content here");
     Response.Flush();
     Response.End();
  </code></pre>
  
  <p>Using Respose.Redirect(Request.RawUrl) will not work and will throw an exception stating that the redirection cannot happen once the headers are posted...</p>
  
  <p>Can some one tell me, why the code execution is not stopped by Response.End() ??</p>
  
  <p>EDIT: Actual Code</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
  
          if (Session["localTime"] == null &amp;&amp; String.IsNullOrEmpty(Request.Params["localTime"]))
          {
              // then clear the content and write some html, a javascript code which submits the local time
              Response.ClearContent();
              Response.Write(@"&lt;form id='local' method='post' name='local'&gt;
                                  &lt;input type='hidden' id='localTime' name='localTime' /&gt;
                                  &lt;script type='text/javascript'&gt;
                                      document.getElementById('localTime').value = new Date();
                                      document.getElementById('local').submit();
                                  &lt;/script&gt;
                              &lt;/form&gt;");
              // 
              Response.Flush();
  
              // end the response so PageLoad, PagePreRender etc won't be executed
              Response.End();//Page must reload after this line.
          }
          else
          {
  
              // if the request contains the localtime, then save it in Session
              if (Request.Params["localTime"] != null)
              {
                  Session["localTime"] = Request.Params["localTime"];
                  Response.Write(Request.Params["localTime"] + " ~2");
                  // and redirect back to the original url
                  Response.Redirect(Request.RawUrl);
              }
  
          }
  
      }
  </code></pre>