How to redirect after File upload?
<p>I have a File.aspx form where I display all the files.</p>

<p>When I upload a file I am using a upload.aspx file to run c# code to upload the file.</p>

<p>The thing is that at the end , I want to refresh the page automatically to display the new file upload but apparently it's not redirecting even if all the parameters are good.</p>

<p>This is the code I use </p>

<pre><code>        HttpContext postedContext = HttpContext.Current;
        string param = Request.UrlReferrer.Query;
        string param2 = Request.UrlReferrer.Query;
        var url = HttpUtility.ParseQueryString(param).Get("projectName");
        var url2 = HttpUtility.ParseQueryString(param2).Get("projectId");
        HttpPostedFile file = postedContext.Request.Files[0];
        string name = file.FileName;
        byte[] binaryWriteArray = new
        byte[file.InputStream.Length];
        file.InputStream.Read(binaryWriteArray, 0,
        (int)file.InputStream.Length);
        //FileStream objfilestream = new FileStream(Server.MapPath("~\\" + "\\Files\\" + url + "\\" + name), FileMode.Create, FileAccess.ReadWrite);
        FileStream objfilestream = new FileStream(("C:\\inetpub\\wwwroot\\Clientportal\\Files\\" + url + "\\" + name), FileMode.Create, FileAccess.ReadWrite);
        objfilestream.Write(binaryWriteArray, 0, binaryWriteArray.Length);

        objfilestream.Close();
        string[][] JaggedArray = new string[1][];
        JaggedArray[0] = new string[] { "File was uploaded successfully" };
        JavaScriptSerializer js = new JavaScriptSerializer();
        string strJSON = js.Serialize(JaggedArray);
        Response.Write(strJSON);

        Response.Redirect(string.Format("Files.aspx?projectId={0}&amp;projectName={1}", url2, url));
</code></pre>

<p>Any ideas ? I'm a bit stuck because I use this response.redirect everywhere and it works only when the code is in the same code file...</p>

<p>Maybe it's because of the fact that I try to redirect from another code file ?</p>
