473,388 Members | 1,493 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,388 software developers and data experts.

Params & QueryString

Assume that an ASPX page is accessed using the following URL:

http://myserver/Page1.aspx?fname=john

The value of the querystring fname (which is john) can be retrieved
using both Request.Params("fname") & Request.QueryString("fname").

So what's the difference between Request.Params("fname") &
Request.QueryString("fname")?

Sep 29 '06 #1
2 7214
From my understanding, Request.Params is kind of like the old way I've seen
in Classic ASP, using Request("fname")
Here the problem is that it will go through all the possible collections
until it finds what it needs (QueryString, Form, ServerVariables, and
Cookies items)
So - the most efficient way, when using Querystrings is
Request.Querystring("fname")
Also, if you have a (let's say) a querystring AND a cookie called "ID", and
just used Request.Params - - you will probably have problems. I haven't
tested this, but it would seem to be the case.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
<rn**@rediffmail.comwrote in message
news:11**********************@c28g2000cwb.googlegr oups.com...
Assume that an ASPX page is accessed using the following URL:

http://myserver/Page1.aspx?fname=john

The value of the querystring fname (which is john) can be retrieved
using both Request.Params("fname") & Request.QueryString("fname").

So what's the difference between Request.Params("fname") &
Request.QueryString("fname")?

Sep 29 '06 #2
Thus wrote rn**@rediffmail.com,
Assume that an ASPX page is accessed using the following URL:

http://myserver/Page1.aspx?fname=john

The value of the querystring fname (which is john) can be retrieved
using both Request.Params("fname") & Request.QueryString("fname").

So what's the difference between Request.Params("fname") &
Request.QueryString("fname")?
Params "gets a combined collection of QueryString, Form, ServerVariables,
and Cookies items" (quoting MSDN).

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Oct 5 '06 #3

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

Similar topics

4
by: Luklrc | last post by:
Hi, I'm having to create a querysting with javascript. My problem is that javscript turns the "&" characher into "&amp;" when it gets used as a querystring in the url EG: ...
2
by: JDeats | last post by:
I have a WinForms based application that I'm launching over http (Microsoft's buzz word for this is aparently "SmartClient"). I had an issue trying to get parameters passed in through the URL that...
2
by: Kevin | last post by:
I am attempting to fetch the value of a paramter passed in on the http request url. Example: http://localhost.mypage.aspx?ID=12345 In the URL above I am wanting to retrieve the value of the...
2
by: ndario | last post by:
i am trying to transfer a user to another page with Server.Transfer() but i am having a problem with sending query params like this Server.Transfer("newPage.aspx?param=value"); in the PageLoad...
4
by: Brian H | last post by:
Hi all, I'm trying to add querystring parameters onto an ASP image control ImageUrl property. Basically, the aspx page defines the base URL (such as ImageUrl = http://localhost) and the class...
0
by: Quinn Wilson | last post by:
I've got a breakpoint set in my code and I'm looking at 3 watches which (I think) should be functionaly equivalent" Request.Params(callingPage) "" String...
1
by: EoRaptor013 | last post by:
Not sure where to ask this question, but... I'm using a TreeView component to enable browsing file folders in a specific directory (for test purposes /Program Files/). Some users use an ampersand...
3
by: Tony | last post by:
I see that many pages have &amp; in querystring instead &. What is difference? Can I put page link (url) www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write...
2
by: FFMG | last post by:
Hi, I was looking at http://www.php.net/manual/en/function.call-user-func-array.php and I was wondering... Given, // -- function foo( &$params) {
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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,...
0
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...

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.