Stack Exchange
Javascript from C# code behind only refreshes in Google Chrome
My site has an asp.net button to post values to an external website, which works properly in IE and Firefox. It redirects back to the same page in Chrome.
    using (WebClient client = new WebClient())
    {
        HttpContext.Current.Response.Write(string.Format("<body onload=document.forms[0].submit();window.location=\"{0}\";>", "Dashboard.aspx"));
        HttpContext.Current.Response.Write(string.Format("<form name=\"Form\" target=_blank method=post action=\"{0}\">", URL));
        HttpContext.Current.Response.Write(string.Format("<input type=hidden name=\"fname\" value=\"{0}\">", FirstName));
        HttpContext.Current.Response.Write(string.Format("<input type=hidden name=\"lname\" value=\"{0}\">", LastName));
        HttpContext.Current.Response.Write(string.Format("<input type=hidden name=\"id\" value=\"{0}\">", ID));
        HttpContext.Current.Response.Write(string.Format("<input type=hidden name=\"tier\" value=\"{0}\">", tier));
        HttpContext.Current.Response.Write(string.Format("<input type=hidden name=\"promo_code\" value=\"{0}\">", promoCode));
        HttpContext.Current.Response.Write(string.Format("<input type=hidden name=\"login_key\" value=\"{0}\">", hashedKey));
        HttpContext.Current.Response.Write("</form>");
        HttpContext.Current.Response.Write("</body>");
    }

Desired behavior is to open a new tab or window with the external site loaded, with the parameters passed via POST. 
Current behavior is the page simply refreshes. Is this a known issue with Chrome? My guess is that it's blocking the javascript as it thinks it's being "injected".

check out this from SO Click Here

My guess is you've got a race between posting the form & changing the url.
The window.location.href is not needed. Submitting the form should be enough. Also you probably should quote those attributes correctly to see if that helps.

What do you mean by "quote those attributes correctly"?

This fixes the problem, however now the original page is empty and white. But adding a response.redirect later on in the code then invalidates the form post / new tab.
