471,595 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,595 software developers and data experts.

looping what the heck?

Given this:
***************************

For Each entryName In Request.Form

Response.Write("Name: " & entryName & "<br/>")

Response.Write("Value: " & Request.Form(entryName) & "<br/>")

Next

****************************

there are several properties of a form field

when i loop through the "items", how am I supposed to know which of the
"items" or "properties" i am looping through

for instance, request.form has items, keys, allkeys, count.

why doesn't this pull in the "keys", rather than the "items".

Jan 30 '07 #1
1 976
Request.Form (and Request.QueryString) are NameValueCollections.
If you want keys and their values:

For x As Integer = 0 To Request.Form.Count - 1
Response.Write(String.Format("{0}={1}", Request.Form.Keys(x),
Request.Form(x))
Next

-Peter

Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Mr. SweatyFinger" wrote:
Given this:
***************************

For Each entryName In Request.Form

Response.Write("Name: " & entryName & "<br/>")

Response.Write("Value: " & Request.Form(entryName) & "<br/>")

Next

****************************

there are several properties of a form field

when i loop through the "items", how am I supposed to know which of the
"items" or "properties" i am looping through

for instance, request.form has items, keys, allkeys, count.

why doesn't this pull in the "keys", rather than the "items".

Jan 30 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Karen | last post: by
45 posts views Thread by Trevor Best | last post: by
5 posts views Thread by masood.iqbal | last post: by
3 posts views Thread by Ryan Ternier | last post: by
1 post views Thread by Diva | last post: by
2 posts views Thread by Davaa | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.