dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Web
Expertise: Beginner
Jun 5, 2000

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Convert Form Collection into a String

You can convert the entire Request.Form collection into a single string variable just by referencing the collection without specifying the key or index.

The format of the string would look like as follows:

 
KeyName1=KeyValue1&KeyName2=KeyValue2&....
Basically the string would contain all the name/value pairs where each name/value pair is separated from the others with an ampersand (&) character. This is useful if you want to cache the entire collection in some hidden field for future processing.

If you have following form declaration in your ASP page:

 
<FORM ACTION="PhoneSample.asp" METHOD="POST">
Work Phone:<INPUT TYPE="TEXT" NAME="WorkPhone"></INPUT>
Home Phone:<INPUT TYPE="TEXT" NAME="HomePhone"></INPUT>
<INPUT TYPE="SUBMIT" NAME="bttnSubmit" VALUE="SUBMIT"></INPUT>
</FORM>
Then this code would convert the Form collection into a string variable when the user clicked on the submit button.
 
<%
Dim strFormCollection

' this call will convert the entire collection 
' into a string.
strFormCollection = Request.Form

' format of strFormCollection would look like
' WorkPhone=111222333&HomePhone=444555666

%>

Deepak Pant
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date