I have a page redirect that runs after a string is written to an MSword doc using WebClient and StringBuilder.
HttpContext.Current.Response.Write(strHTMLContent);
this.Page.Response.Redirect("http://www.google.com");
HttpContext.Current.Response.End();
However the string never gets written (or it doesn't get the chance to) since the redirect happens instantly.
How can i make my redirect run only until the string Write has occurred?
Thanks guys
This is the code used to generate the MSWord:
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentType = "application/msword";
string strFileName = "GenerateDocument" + ".doc";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + strFileName);
StringBuilder strHTMLContent = new StringBuilder();