ASP.net equivalent ?

T

TJS

what would be the ASP.net equivalent of this ASP code ?

for x = 1 to request.form.count()
'response.write(request.form.key(x) & " = ")
response.write(request.form.item(x) & "<br>")
next
 
P

Patrice

Just counting from 0 to Count-1 should be enough...

Else tell us what is the the result you have with this code (error message,
at compile time, at runtime ?)

Patrice
 
T

TJS

vb.net language

the error message is:

Compiler Error Message: BC30456: 'key' is not a member of
'System.Collections.Specialized.NameValueCollection'.
 
P

Patrice

Sorry, thought this line was commented. This is "Keys" in ASP.NET.

I recommend using Intellisense or having a good reference handy (for example
WebMatrix comes with a class browser).

Patrice

--
 
K

Kevin Spencer

what would be the ASP.net equivalent of this ASP code ?


for x = 1 to request.form.count
'response.write(request.form.key(x) & " = ")
response.write(request.form.item(x) & "<br>")
next

Explanation: VB.Net is Object-Oriented, which means that it is an extended
form of the procedural VB. Object-Oriented languages use procedural code all
the time. As the syntax is nearly identical with VB, with the exception of
the OOP extensions, it would be the same.

Now, the problem with your question is that it is asking about a couple of
lines of code. That is NOT where VB and VB.Net diverge. It is with the
programming model itself that the divergence takes place.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top