Hi all.
I have a question in using Request and Request.Form
when the asp page is Request("txtNam e")
i can use "testpage.aspx? txtName=User1" to post the value
but when i use Request.Form("t xtName")
i cannot use that method,
what can i do to solve that problem
(as i cannot modifty the request.form syntax but i need to post data to that
web page, is there any method so that i can pass that parameter?)
thx and regards,
Norton 4 1994
When you attempt to retrive a value from Request.Form you are specifying that
you want the system to return a value that was POST'd to the page with that
name. If your form is using GET (or you are manually bulding the querystring
value) you would want to use Request.QuerySt ring("aName") to retrieve the
value.
The reason using Request("aName" ) works in either case is because by not
defining which collection you would like it to look in, it attempts to find
the first matching key in any of it's collections (.Form, .QueryString,
..Cookies, .ServerVariable s). Obviously by not specifyingwhich collection you
would like it to look in you are introducing more overhead because it may
have to search all four collections to find that the given key doesn't exist.
-T
Also be aware that you may step into trouble if you don't specify which
collection you want to search in if you have a variable with the same name
(which is of course not good programming practice) in for example both the
querystring and the form collection. Then it will take the first one in this
order
1. Querystring
2. Form
3. Cookies
4. ClientCertifica te
5. Server variables.
Regards
/Hans http://www.aspfaq.com/2111
-- http://www.aspfaq.com/
(Reverse address to reply.)
"norton" <no********@hot mail.com> wrote in message
news:O7******** *****@TK2MSFTNG P11.phx.gbl... Hi all.
I have a question in using Request and Request.Form
when the asp page is Request("txtNam e")
i can use "testpage.aspx? txtName=User1" to post the value
but when i use Request.Form("t xtName") i cannot use that method,
what can i do to solve that problem
(as i cannot modifty the request.form syntax but i need to post data to
that web page, is there any method so that i can pass that parameter?)
thx and regards, Norton
norton wrote: i can use "testpage.aspx? txtName=User1" to post the value...
No, you can't.
You can PASS a value that way, but POST means something very specific, and
if you had, in fact, posted such a name-value pair, you wouldn't have the
following problem:
but when i use Request.Form("t xtName") i cannot use that method,
"The Form collection retrieves the values of form
elements posted to the HTTP request body, with a
form using the POST method." http://msdn.microsoft.com/library/en...bom_reqocf.asp
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Christopher Brandsdal |
last post by:
Hi!
I have a problem running my code on 2000 server and iis5.0.
The code runs perfectly on my localhost (xp iis5.1) but when i run it on
2000 server iis5.0 I get this error:
--------------------------------------
operation must use an updateable query
|
by: wk6pack |
last post by:
Hi,
I have an asp page that I would like to do paging. The problem I'm running
into is that the same page that prints to the output is also recieving data
from the previous page for query parameters for the sql string.
When I click on the next page, it queries itself and loses all the query
parameter information from the parameter page and brings back all the
records.
|
by: Kingdom |
last post by:
I have a SelectBoxes.asp page that is working with multiple selection
dropdown boxes to extract data and total the selection prices.
Tom & Bob were kind enough to give me a big help getting this page
working and it's working just fine, no problems with this page.
However I then would like this data e-mailed using jmail (my host insists
on this method) and that is the function of the sendEMail2.asp page.
This is failing and only giving...
|
by: Harag |
last post by:
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>Request.Form="+ Request.Form("Box1").Item);
out("<br>Request.Form="+ Request.Form("Box2").Item);
|
by: fripper |
last post by:
I posted this problem a couple of days ago but felt I might have better luck
re-stating the problem.
Apparently I messed up IIS (v. 5) somehow because I am suddenly unable to
load web forms! A simple example will help.
I created a simple web project that contains two simple forms ...
WebForm1 and WebForm2. WebForm1 has a button which when clicked simply does
a Response.Redirect("WebForm2.aspx"). When I run the program and click the...
| |
by: Jack |
last post by:
Hi, I have a asp page where part of the code is as follows. This builds up
the sql statement partially.
sql01 = "UPDATE EquipmentTbl SET "
sql01 = sql01 & "SerialNumber = '" & request.form(strSerialNum) & "', "
sql01 = sql01 & "Description = '" & request.form(strDesc) & "', "
sql01 = sql01 & "Location = '" & request.form(strLoc) & "', "
|
by: anthonybrough |
last post by:
I have an asp page that has a form to collect user data in a form.
when the user clicks submit the input is validated. If any fields are
not acceptable the user clicks on a button to go back to the original
form to correct the input. This all works fine until I try to
incorporate a javascript to display a popup calendar which posts the
selected date back to a field on the form. This script works fine in
itself, however if the page is...
|
by: phpfreak2007 |
last post by:
Hi all,
I am trying to upload file using VB HTTP Post method and winsock control . Can successfully upload the files when client machine is English OS, but create problem when upload from Chinese OS. Currently what i am doing is reading file in string and then build a html request and send these string data to upload. fuction which read a file content and buildhttp request is given below.. can anyone suggest what is the problem. is it so...
|
by: shlim |
last post by:
Currently I'm using VB.Net to perform a http/https multipart form post to a servlet. I'm able to perform the post using HttpWebrequest via GetRequestStream(). However, the servlet returned me with "The remote server returned an error: (500) Internal Server Error". Obviously, this means that I have not posted all the parameters as the servlet requested. But I just can't seem to find out what went wrong with my code. Hope someone can enlighten me,...
|
by: chromis |
last post by:
Hi,
I'm having trouble fully implementing the edit section of a contact admin system, so far I have written the following:
- Bean (Contact.cfc)
- Data Access object (ContactDAO.cfc)
- Gateway (ContactGateway.cfc)
- index.cfm - Deals with the business logic
- display/form.cfm - Produces the form for both add and edit behaviour
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |