newbie form post question

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default newbie form post question

    Please tell me how I can get the values and items for a form posted using
    the post method.

    The posting page is HTML and I won't know what's in it ahead of time...

    How can I get a item/value pair for it.

    I'm sure it is simple but haven't figured it out.

    Thanks

    Shane


    SStory Guest

  2. Similar Questions and Discussions

    1. Two page form-newbie question
      I have a form, set up in Pagemaker and converted to to a PDF file with Acrobat Pro 6. I need to email this to people. Ideally I would like the form...
    2. Form action question -- remost POST using XMLHTTP
      Hi everyone, I am trying to post some data to a form using the XMLHTTP object, and have run into a problem trying to find the proper location of...
    3. Newbie question: I need an ASP script to store data from a form.
      I want to have a HTML form that the user fills in and clicks submit. I then want the data to be stored in an Access datatbase. I've loooked and...
    4. Using ASP.Net controls within an XmlDocument instance -- and post form question?
      Hi, I would be grateful for any guidance in how to achieve the following. I have an aspx page in which I transform an xmlDocument instance to...
    5. Probably an easy form question from a newbie
      This question is probably something really simple, but I am not too familiar with Access 2k. So far all of my efforts are in vein. Any help or...
  3. #2

    Default Re: newbie form post question

    Would somethin glike this work?:

    Dim idict As System.Collections.IDictionaryEnumerator = CType(Request.Form,
    System.Collections.IDictionaryEnumerator)
    While idict.MoveNext
    Dim key As String = CStr(idict.Key)
    Dim value As String = CStr(idict.Value)
    End While

    Karl

    "SStory >" <Shane_Story@online.msn.com <remove the 'online.' to send me
    mail> wrote in message news:%23i9iyr5VDHA.2544@tk2msftngp13.phx.gbl...
    > Please tell me how I can get the values and items for a form posted using
    > the post method.
    >
    > The posting page is HTML and I won't know what's in it ahead of time...
    >
    > How can I get a item/value pair for it.
    >
    > I'm sure it is simple but haven't figured it out.
    >
    > Thanks
    >
    > Shane
    >
    >

    Karl Seguin Guest

  4. #3

    Default Re: newbie form post question

    Request.Form is a NameValueCollection, containing the names and values of
    all the form fields in the form that posted to the current Page. All you
    have to do is iterate through it.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    [url]http://www.takempis.com[/url]
    Complex things are made up of
    lots of simple things.

    "SStory >" <Shane_Story@online.msn.com <remove the 'online.' to send me
    mail> wrote in message news:%23i9iyr5VDHA.2544@tk2msftngp13.phx.gbl...
    > Please tell me how I can get the values and items for a form posted using
    > the post method.
    >
    > The posting page is HTML and I won't know what's in it ahead of time...
    >
    > How can I get a item/value pair for it.
    >
    > I'm sure it is simple but haven't figured it out.
    >
    > Thanks
    >
    > Shane
    >
    >

    Kevin Spencer Guest

  5. #4

    Default Re: newbie form post question

    give me this...
    Specified cast is not valid.

    I can't imagine why this should be so ridiculous nor can I found information
    on it.

    I need info from an HTML page, not the same ASPX page and it will be POST
    instead of GET.

    I looked at request.form.key, .getvalues.
    Not sure what they do and can't find explanation

    if you have any more ideas please let me know..


    Thanks a bunch,

    Shane

    "Karl Seguin" <kseguin##crea.ca> wrote in message
    news:OJJS1v5VDHA.2364@TK2MSFTNGP09.phx.gbl...
    > Would somethin glike this work?:
    >
    > Dim idict As System.Collections.IDictionaryEnumerator =
    CType(Request.Form,
    > System.Collections.IDictionaryEnumerator)
    > While idict.MoveNext
    > Dim key As String = CStr(idict.Key)
    > Dim value As String = CStr(idict.Value)
    > End While
    >
    > Karl
    >
    > "SStory >" <Shane_Story@online.msn.com <remove the 'online.' to send me
    > mail> wrote in message news:%23i9iyr5VDHA.2544@tk2msftngp13.phx.gbl...
    > > Please tell me how I can get the values and items for a form posted
    using
    > > the post method.
    > >
    > > The posting page is HTML and I won't know what's in it ahead of time...
    > >
    > > How can I get a item/value pair for it.
    > >
    > > I'm sure it is simple but haven't figured it out.
    > >
    > > Thanks
    > >
    > > Shane
    > >
    > >
    >
    >

    SStory Guest

  6. #5

    Default Re: newbie form post question

    Thanks a million.... Whew... The docs said it lists all forms on a page so I
    was thrown off..

    for anybody else who needs to know the easy way of doing this is:

    dim i as short

    For i = 0 To Request.Form.Count - 1
    Response.Write(Request.Form.Keys(i) & "=" & Request.Form.Item(i) & &
    "</br>")
    Next i

    "Kevin Spencer" <kevin@takempis.com> wrote in message
    news:uB31615VDHA.2368@TK2MSFTNGP09.phx.gbl...
    > Request.Form is a NameValueCollection, containing the names and values of
    > all the form fields in the form that posted to the current Page. All you
    > have to do is iterate through it.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > [url]http://www.takempis.com[/url]
    > Complex things are made up of
    > lots of simple things.
    >
    > "SStory >" <Shane_Story@online.msn.com <remove the 'online.' to send me
    > mail> wrote in message news:%23i9iyr5VDHA.2544@tk2msftngp13.phx.gbl...
    > > Please tell me how I can get the values and items for a form posted
    using
    > > the post method.
    > >
    > > The posting page is HTML and I won't know what's in it ahead of time...
    > >
    > > How can I get a item/value pair for it.
    > >
    > > I'm sure it is simple but haven't figured it out.
    > >
    > > Thanks
    > >
    > > Shane
    > >
    > >
    >
    >

    SStory Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139