Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASP - Request Object
Message
De
22/02/2000 07:18:34
Scott Knight
Human Resources Development Canada
St. John's, Terre-Neuve, Canada
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00334833
Message ID:
00335300
Vues:
15
>>I tried what you suggested and I can certainly see how it can work. However, request.form returns and awful ugly piece of string with numerous characters encoded into it. I could see this getting very long and hard to code and manage. I may even be way of track in what I am trying to do. I thought I would receive the Request Object in the Ofaxserver.Save method. If the hidden input field FaxKey was empty I would consider it an add else It would be a edit. I would then get the record as an object using scatter name or scatter name blank. I would then update the record object based on what was in the Request object through what I had hoped was a small for next loop something to the effect of :
>>
>>For x = 1 to ItemsInRequest
>>lcItemName = Request.Form.Item(x) ???
>>lcItemValue = ???
>>
>>loRecord.lcItemname = lcItemValue
>>next
>>
>>Send loRecord to the actual table.
>
>I do not know if VFP's "For Each" can iterate through the request collection but if it can you should be able to use:
>
>*Using Form post
>FOR EACH x IN Request.Form
> lcItemName = x
> lcItemValue = Request.form(x)
> .....
>next
>
>*Using Form Get
>FOR EACH x IN Request.QueryString
> lcItemName = x
> lcItemValue = request.QueryString(x)
> .....
>next


I worked some additional problems getting this to work properly. I think the only change is adding the .item() to the end of Request.form(x). Request.form(x) returns the value from the request but it was Object data Type. Request.form(x).Item() returns the same value except it is a character string which is what I was after. The following snippet builds a string from each of the Items and corresponding values and sends it back to the browser for display.

Parameter loRequest
lcRetStr =""
For each x in loRequest.Form
lcItemname = x
lcItemValue = loRequest.form(x).Item()
lcRetStr = lcRetStr + "
Item Name : " + lcItemname + " ---> Item Value : " + lcitemvalue
Next
return lcRetStr

Scott
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform