473,568 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

for i in Request.From problem

Hi All

Using: JScript
IIS 5

I have a problem in the following code:

// The next 4 lines display exactly what was typed in the text boxes.
out("<br>Reques t.Form="+ Request.Form("B ox1").Item);
out("<br>Reques t.Form="+ Request.Form("B ox2").Item);
out("<br>Reques t.Form="+ Request.Form("B ox3").Item);
out("<br>Reques t.Form="+ Request.Form("B ox4").Item);
out("<br>typeof ="+ typeof Request.Form); //returns "object"
// Problem here
for (var i in Request.Form) {
out('Element Text:' + Request.Form(i) .Item);
}

[snipped rest]
My Problem is that the for loop is not going through each element of
the form and displaying. it just seems to skip those 3 line and
continues with the code, no errors and no text. The values are stored
in the form elements as the 5 lines of output above clarifies this
fact.

Can anyone spot the problem please???

Thanks.

Al.

Jul 19 '05 #1
2 1744
*Harag* wrote:
Hi All

Using: JScript
IIS 5
[snip]
// Problem here
for (var i in Request.Form) {
out('Element Text:' + Request.Form(i) .Item);
}
[snip]
Can anyone spot the problem please???


I don't think Request.Form is enumerable in that way, here's the version
I use:

function EnumeratePostDa ta() {
var objO = [];
for (var e = new Enumerator(Requ est.Form); !e.atEnd(); e.moveNext()) {
var key = e.item();
var count = Request.Form(ke y).Count;
for (var i=1; i<=count; ++i) {
objO.push(Serve r.HTMLEncode(ke y) + "=" +
Server.HTMLEnco de(Request.Form (key).Item(i))) ;
}
}
return objO.join("\r\n ");
}
--
Andrew Urquhart
- FAQ: http://www.aspfaq.com
- Archive: http://tinyurl.com/38kzx (Google Groups)
- Contact me: http://andrewu.co.uk/contact/
- This post is probably time-stamped +1 hour - blame my ISP (NTL)
Jul 19 '05 #2
On Tue, 17 Aug 2004 12:08:47 GMT, "Andrew Urquhart"
<us************ **************@ spam.invalid> wrote:
*Harag* wrote:
Hi All

Using: JScript
IIS 5

[snip]
// Problem here
for (var i in Request.Form) {
out('Element Text:' + Request.Form(i) .Item);
}


[snip]
Can anyone spot the problem please???


I don't think Request.Form is enumerable in that way, here's the version
I use:

function EnumeratePostDa ta() {
var objO = [];
for (var e = new Enumerator(Requ est.Form); !e.atEnd(); e.moveNext()) {
var key = e.item();
var count = Request.Form(ke y).Count;
for (var i=1; i<=count; ++i) {
objO.push(Serve r.HTMLEncode(ke y) + "=" +
Server.HTMLEnc ode(Request.For m(key).Item(i)) );
}
}
return objO.join("\r\n ");
}


for (var e = new Enumerator(Requ est.Form); !e.atEnd(); e.moveNext())
Cool the above works a treat now. thanks.

(heads off to read up on Enumerator)

Al.
Jul 19 '05 #3

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

Similar topics

6
3138
by: Daniel Rimmelzwaan | last post by:
I want to send a biztalk document to an aspx page, and I need to see some sample code, because I just can't make it work. I have a port with transport type HTTP, pointing to my aspx page, something like http://myserver/mypage.aspx. From there it gets blurry, because I just can't figure out how to do the rest. Does anybody have a sample page...
6
3790
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is...
4
5122
by: Jit Prasad | last post by:
I have a working client-side Vb.Net (.net v1.0) app that talks to a Webspere webservice on a windows 2000 server. The client side app runs on a citrix server, also a Windows 2000 server. The app worked ok till I installed .Net v1.1 on the citrix, now I get an error when I get the app to use .NET v1.1. If the app uses .NET v1.0 (with .NET...
7
2521
by: SevDer | last post by:
Hi I have a class library that needs to download the HTML in a specific page of ours with provided querystring. When I open this URL with any browser, it loads fine. When I do WebRequest from Web Project it is again fine. However whenever I do this request from this class library, it fails. I put every kind of user permission to the actual...
8
14057
by: Tim Reynolds | last post by:
Our .Net application calls a web method of aplpication 2 that resides on their Apache server. When I as a developer C#, Studios 2003, make the call to their web method from my desktop, I receive no exceptions - completes fine. Their web service url was added as a web reference to our project with no problem. The following was generated as part...
14
2071
by: Harry Keck | last post by:
I have client side code that uses xmlhttp to make an asyncronous call to the server. This call really churns the server and can take a couple of minutes to finish. I have found that while this long call is processing, I can not make any more requests to the server from the same session. I found this because if I have two completely separate...
18
5432
by: Thomas Lunsford | last post by:
I have inherited a set of asp pages that I now need to augment. In order to minimize changes to production code, I would like to make a "call" to an asp page from a new asp page. Existing code is using many Request.Form variables, and I would very much prefer not to change this code. The new page will retrieve data that I would like to...
5
1816
by: Rory Becker | last post by:
I have had code in my Application_Start which is intended to run once at the start of my application's life. It loads connection information and similar from a known location. However I recently migrated my app using ------------------------------------------------------------- %systemroot%\system32\inetsrv\APPCMD.EXE migrate config...
3
1767
by: Joseph Geretz | last post by:
I'm using the Request Filter documentation which can be found here: http://msdn.microsoft.com/en-us/library/system.web.httprequest.filter.aspx In this example, two filters are installed, one filter uppercases every alphabetic character and then the second filter replaces every 'E' with "#'. OK, very nice. What's trivial about these...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6275
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.