ASP.net equivalent ?

  • Thread starter Thread starter TJS
  • Start date Start date
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
 
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
 
vb.net language

the error message is:

Compiler Error Message: BC30456: 'key' is not a member of
'System.Collections.Specialized.NameValueCollection'.
 
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

--
 
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

Back
Top