 <p>You're writing the updated document text to <code>StreamWriter sw</code> but then not doing anything with it. You are then setting the session variable to your original, unedited byte array <code>memoryStream</code> (which is presumably why you're returning a document with no changes).</p> <p>You need to convert <code>sw</code> to a byte array and put that in <code>Session["ByteArray"]</code> instead.</p> <p>Also, a large byte array in a session variable does not seem like a terribly good idea.</p>