Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2003, 02:19 PM
Authorized User
 
Join Date: Jul 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing parameters between pages

I've been using querystring to pass values between pages, and noticed they can be retrieved by either Request.Params[varName], or Request.Querystring[varName]. Is there a difference, and is either more efficient?
 
Old July 1st, 2003, 11:32 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Hi There:
To pass values between pages, we have 2 method!! Request.Querystring[varName] & Request.Form[varName]
Dear friend Request.Params[varName] is something else!!!
So to pass values between pages u have 2 ways as I said, but what are the different between them is a story:
we have 2 kind of methods in <form> tag of HTML.
[u]"post"</u> : Will pass the values hidden from user & within pages, u'll use Request.Form[varName]
[u]"get" </u> : in this case u can see the values in the end of ur page address.u'll use Request.Querystring[varName]
u cant use "get" method in login pages but is usefull in links

Anyway I have no URL to give u but can check it in internet there is a lot of help! look for HTML help.
I hope I could help u.

Always:),
Hovik Melkomian.
 
Old July 7th, 2003, 10:41 AM
Authorized User
 
Join Date: Jul 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To clarify, I'm not actually using a form submit to send pages, I'm using the Response.Redirect command in my C# code-behind file. Once the page is redirected, I fetch the querystring params with the Request.Params[varName] command, and it seems to work just fine. Thanks.
 
Old July 7th, 2003, 02:11 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I think Hovik doesn't know this is an ASP.NET forum, as his answer seems quite classic ASP related.

Anyway, here's what the MSDN says about both collections:

QueryString
Gets the collection of HTTP query string variables.

Params
Gets a combined collection of QueryString, Form, ServerVariables, and Cookies items.

Unfortunately, it doesn't provide any detail about the order the collections are searched, nor is it clear to me whether you can change that order (like in PHP).

Personally, I don't think there is much of a performance difference. However, I prefer to be explicit. So if you know you want to retrieve your values from the QueryString, use Request.QueryString. It makes things much easier to understand and debug.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameters fizzerchris Access VBA 5 August 31st, 2007 12:16 PM
Passing parameters tal Ajax 5 May 26th, 2007 08:07 AM
Passing parameters ceema Crystal Reports 0 February 15th, 2006 04:03 AM
Passing Parameters spraveens Javascript 5 October 8th, 2003 07:06 AM
passing parameters spraveens Javascript How-To 1 October 8th, 2003 03:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.