ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 5th, 2003, 05:33 PM
vdao vdao is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 vdao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How to get contents of a post in ASP?

I'm trying to access and iterate through POST variables. I'm thinking of something similar to PHP, where on a submit it creates a POST object, which is an associative array of all the variables.

Is ASP the same way? Is there any way to see what is in the array and have access to it's contents without knowing the contents beforehand?

The reason I ask is because I have about 100 check boxes, and the user only checks a number of them - each check box is named differently. I want to, on the post page, to find out which ones were checked, short of putting an if else or select to check all 100 of them. Is there an easier way?

I tried printing out the post: Response.Write(Request.Form()), and all that gave me was the querystring

Reply With Quote
  #2  
Old September 6th, 2003, 12:42 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
well that's awful lazy of you, this has been answered twice within the past few days? A good thing to do before posting is searching on google, if not there try looking around the devshed postings. Both of these are viewable within the first 2 pages, let alone a search.....you need to look before posting...

http://forums.devshed.com/t80981/s.html

http://forums.devshed.com/t80986/s.html

Reply With Quote
  #3  
Old September 6th, 2003, 06:45 AM
WebHosts WebHosts is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 WebHosts User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Is this what you are looking for......?

Code:
<%
Dim objItem ' As Variant
For Each objItem In Request.Form
    Response.Write(objItem & " = " & Request.Form(objItem) & "<br>" & vbCrLf)
Next
%>

Reply With Quote
  #4  
Old September 8th, 2003, 01:01 PM
vdao vdao is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 vdao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks guys. I actually DID a search for it, but those two links you gave wasn't what I was looking for (unless I didnt read too far down in those posts). I was already doing the split thing between the = and & but that didn't seem like the best way to handle it.

Thanks WebHosts, exactly what I was looking for.

Reply With Quote
  #5  
Old September 8th, 2003, 01:05 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
the links actually show you how to do it, and do work but i agree i always thought there could be another way.....
WebHosts method is much more sophisticated/coherant, i had no idea you could manipulate it that way, i'd recommend doing it his way cause i certainly will be =)

Reply With Quote
  #6  
Old September 8th, 2003, 01:44 PM
vdao vdao is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 vdao User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
exactly! this is more in line with how PHP does it...which was the question I was askin ;-)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > How to get contents of a post in ASP?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT