title: Post to another page site works, but shows a blank page in the process
body: <p>I am posting values to from an ASP.NET website to a completely different site (Paypal actually). I accomplish this by returning a page to the user that has all the hidden form inputs written and then a Javascript function that automatically submits the form.</p>
  
  <p>The process is supposed to be seamless, but the blank page is noticeable for the couple seconds it shows up. Users are just supposed to click the button on the ASP.NET page, then be redirected to Paypal. But I inject this blank page in the middle to post the variables in the middle (variables like billing info, order items, etc). The blank page is too noticable and am hoping for either a better way of doing this or suggestions on making the process seem more seamless.</p>
  
  <p>Here is the method I am using:</p>
  
  <pre><code>    public static void PostToRemote(string url, Dictionary&lt;string, string&gt; inputs)
      {
          if (String.IsNullOrEmpty(url))
              return;
  
          HttpContext context = HttpContext.Current;
  
          //CREATE UNIQUE FORM NAME
          string formName = "remoteform1";
  
          //ERASE ENTIRE RENDER OF CURRENT PAGE
          context.Response.Clear();
  
          //OUTPUT SINGLE FORM TO POST DATA
          context.Response.Write("&lt;html&gt;&lt;head&gt;&lt;/head&gt;");
  
          //ON LOAD, PAGE WILL POST FORM TO NEW URL
          context.Response.Write(String.Format("&lt;body onload=\"document.{0}.submit()\"&gt;", formName));
          context.Response.Write(String.Format("&lt;form name=\"{0}\" method=\"{1}\" action=\"{2}\" &gt;", formName, "post", url));
  
          //ADD PARAMETERS TO PAGE TO POST
          foreach (var item in inputs)
          {
              context.Response.Write(String.Format("&lt;input name=\"{0}\" type=\"hidden\" value=\"{1}\"&gt;", item.Key, item.Value));
          }
  
          context.Response.Write("&lt;/form&gt;");
          context.Response.Write("&lt;/body&gt;&lt;/html&gt;");
  
          context.Response.End();
      }
  </code></pre>
  
  <p>Any suggestions in making this more seamless or more enjoyable to the user? Thanks!</p>