473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Simple way to make a string out of Request.Form

Is there a quick way to get all the params and values from the
Request.Form object in ASP.NET?

"If Only it were this simple" Code:
Dim s As String = Request.Form.ToString()

Then s would for example become

id=3&name=Joe+Smith&view=32&page=1&count=1502

Anyone know how to do that? Thanks.

Nov 19 '05 #1
3 1480
Dim loop1 As Integer
Dim arr1() As String
Dim coll As NameValueCollection

' Load Form variables into NameValueCollection variable.
coll=Request.Form

' Get names of all forms into a string array.
arr1 = coll.AllKeys
For loop1 = 0 To arr1.GetUpperBound(0)
Response.Write("Form: " & arr1(loop1) & "<br>")
Next loop1

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
=====================

<cr******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Is there a quick way to get all the params and values from the
Request.Form object in ASP.NET?

"If Only it were this simple" Code:
Dim s As String = Request.Form.ToString()

Then s would for example become

id=3&name=Joe+Smith&view=32&page=1&count=1502

Anyone know how to do that? Thanks.

Nov 19 '05 #2
Thanks Juan,

I guess it was wishful thinking on my part that there was some
undocumented method of the Form class that dumped it all out. Your
code is almost verbatim what I've been having to do.

If only we could inherit from the Form class to add our own
capabilities!

Your fellow Wrox Author - Christopher L. Miller

Nov 19 '05 #3
Hey, Chris!
Long time no hear from you!

re:
code is almost verbatim what I've been having to do.
Yup...it's just about the only way to get at that.

re: If only we could inherit from the Form class
to add our own capabilities!
That'd be nice...

re: Your fellow Wrox Author
We had the best of times with the "old" Wrox, didn't we ?

:-)

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
=====================

<cr******@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com... Thanks Juan,

I guess it was wishful thinking on my part that there was some
undocumented method of the Form class that dumped it all out. Your
code is almost verbatim what I've been having to do.

If only we could inherit from the Form class to add our own
capabilities!

Your fellow Wrox Author - Christopher L. Miller

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mike M | last post by:
Hi all, I ahve the following SQL string but when i try to response.Write it there is a error where the ',' should be between "city" and "County" SQL = "INSERT * INTO customers (Company_Name,...
6
by: Benny Alexander | last post by:
Hi, I am using a simple form 2 email program. I ama experienced programmer, But I feel very bad, as I am unable to fix this problem. All seems to be fine, But the mail is not reacing to my...
7
by: Jeff | last post by:
ok.... i dont know why this wont work. this is going to access DB on web. var1a = Request.Form("h1") var1b = Request.Form("h2") strSQL = "UPDATE matches SET team1a = " & var1a & ", team1b = "...
7
by: Houston | last post by:
I have a form that after being filled out has its contents written to a database and then goes to confirmation .asp page. I want the confirmation page to be personalized but I am not sure how to...
17
by: Paul | last post by:
HI! I get an error with this code. <SCRIPT language="JavaScript"> If (ifp==""){ ifp="default.htm"} //--></SCRIPT> Basicly I want my iframe to have a default page if the user enters in...
2
by: Tomas Vera | last post by:
Hello All, I've come across something that's probably simple, but I can't seem to figure out (probably 'cause it's Monday.. yeah, That's it). Anyway, how do I receive form information from a...
5
by: GregO | last post by:
I am new to ASP and would like to know if anyone has a page that will display username, time, IP TIA - Grego
2
by: eselk2003 | last post by:
I have a Windows application that uses the Windows Internet (wininet) API to post a few lines of text to an ASP.NET page that I'm writing. I know how to process form data in ASP.NET, but not sure...
17
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /*...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.