session object

Results 1 to 2 of 2

Thread: session object

  1. #1
    Join Date
    Dec 1969

    Default session object

    How can I store values in a session variable similar to storing<BR>values in an array? I&#039;m writing a mutliple file upload app and when a user selects a file then I want to store the object in the session variable. I don&#039;t know how many files will be selected and the file selection will be done one file at a time. I tried something like the following:<BR><BR>Public Sub AddFile_Click(By Val sender As System.Object, ByVal e as System.EventArgs) Handles AddFile.Click<BR><BR>Session("files") = UpFile<BR><BR>End Sub<BR><BR>But each time the event is called the latest file selected replaces the file stored in the session object.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: session object

    You could hold the file names in a collection such as an ArrayList or SortedList. eg:-<BR>Dim al As New ArrayList<BR>al = Session("files")<BR>al.Add(UpFile)<BR>Session("fil es") = al

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts