title: CS0120: An object reference is required
body: <p>Getting this error when I submit my form to savetext.aspx action file:</p>
  
  <pre><code>Compiler Error Message: CS0120: An object reference is required for the nonstatic field, method, or property 'System.Web.UI.Page.Request.get'
  </code></pre>
  
  <p>On this line:</p>
  
  <pre><code>string path = "/txtfiles/" + Request.Form["file_name"];
  </code></pre>
  
  <p>Whole code:</p>
  
  <pre><code>&lt;%@ Page Language="C#" %&gt;
  &lt;%@ Import Namespace="System" %&gt;
  &lt;%@ Import Namespace="System.IO" %&gt;
  
  &lt;script runat="server"&gt;
  
  class Test 
  {
      public static void Main() 
      {
          string path = "/txtfiles/" + Request.Form["file_name"];
          if (!File.Exists(path)) 
          {
              using (StreamWriter sw = File.CreateText(path)) 
              {
                  sw.WriteLine(request.form["seatsArray"]);
              sw.WriteLine("");
              }   
          }
  
          using (StreamReader sr = File.OpenText(path)) 
          {
              string s = "";
              while ((s = sr.ReadLine()) != null) 
              {
                  Console.WriteLine(s);
              }
          }
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>How do I fix it?</p>
  
  <p>Thanks!</p>