title: how to passing value of session from page 2 to page 1 in asp.net?
body: <p>I have a listbox and button on the page 1 and when i click on the button, the page 2 will open in a new tab. In the page 2, I'm uploading photos to a folder and set the session["FileName"] value. I want when i close the page 2, names of Uploaded images are displayed in listbox.</p>
  
  <p>Note: session["FileName"] = names of uploaded images.</p>
  
  <p>Does anyone have an idea? Please Help me.</p>
  
  <p>Thank you.</p>
  
  <p>my Upload class:</p>
  
  <pre><code>public void ProcessRequest(HttpContext context)
  {      
      if (context.Request.Files.Count &gt; 0)
      {
          // get the applications path 
  
          string uploadPath = context.Server.MapPath(context.Request.ApplicationPath + "/Temp");
          for (int j = 0; j &lt;= context.Request.Files.Count - 1; j++)
          {
              // loop through all the uploaded files 
              // get the current file 
              HttpPostedFile uploadFile = context.Request.Files[j];
  
              // if there was a file uploded 
              if (uploadFile.ContentLength &gt; 0)
              {
                  context.Session["FileName"] = context.Session["FileName"].ToString() + uploadFile.FileName+",";
                  uploadFile.SaveAs(Path.Combine(uploadPath, uploadFile.FileName));
              }
          }
      }
      // Used as a fix for a bug in mac flash player that makes the 
      // onComplete event not fire 
      HttpContext.Current.Response.Write(" ");
  }
  </code></pre>