title: How to Open MemoryStream File In Browser?
body: <p>I want to create a Text file in my code behind file in my web application. However, I am not allowed to save this file to server. So I tried to use MemoryStream class to save my file into memory. So far I have,</p>
  
  <pre><code>MemoryStream memoryStream = new MemoryStream();
  TextWriter textWriter     = new StreamWriter(memoryStream);
  textWriter.WriteLine("Something");
  memoryStream.Close();
  </code></pre>
  
  <p>It seems like working but my requirement is to open this file on client browser when he/she clicks button. Since this file does not have a physical path like ..../text.txt. I have no idea how to open it on browser.</p>
  
  <p>How can I do this in ASP.Net using C#. I searched a lot but could not find a solution working for me.</p>
  
  <p>Thanks in advance.</p>