Results 1 to 3 of 3

Thread: Can't retrieve values in Hashtable

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Can't retrieve values in Hashtable

    I am capturing the client path for upload files and storing them in a Hashtable from within the btn_UploadFile event.
    VB Code:
    1. 'i is just a counter
    2. 'Add upload path to hashtable
    3. strUploadPath.Add(attachmentFile.PostedFile.FileName.ToString, i)

    In the btn_Submit click event I am trying to iterate through the Hashtable and grab the key/value pairs, but for some reason it isn't returning anything?? and I don't know why???
    VB Code:
    1. For each de in strUploadPath
    2.    Response.Write("Key: " & de.Key)
    3.    Response.Write("<BR>")
    4.    Response.Write("Value: " & de.Value)
    5. Next

    I don't know why it won't retrieve the values??? I have declared both variables in the General Declarations section, so they should be avaliable to any procedure.

    Dim strUploadPath As New Hashtable
    Dim de As DictionaryEntry

    Does anyone know why I wouldn't be able to retrieve these values from the Hashtable???

    ***EDIT***
    If I have it all in the same sub it works, but I need it separated into 2 different subs.
    Last edited by Memnoch1207; Dec 22nd, 2003 at 05:48 PM.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

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



Click Here to Expand Forum to Full Width