473,785 Members | 2,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

querystring pros and cons, help?

Hi folks,
I'm having a discussion with my colleague about how to go about passing data
from one aspx page to another
example
On the main page I have a whole list of relationship managers with a
hyperlink that says 'customers' in each row for each manager and the
hyperlink contains a parameter for that manager and when the 'customers' page
is opened it checks that parameter via its querystring property

is this a bad thing to do?

is there a more generally well regarding method of passing the ID of that
manager to the 'Customers.aspx ' page

I think that querystrings are a perfectly respectable way to do this, my
colleague thinks that it will be slow and inelegant (and is mentioning things
such as server.transfer , server.redirect , which I don' t think are to do with
this kind of typical scenario)

any suggestions would be welcome!

thanks in advance for your help
CharlesA
Jan 12 '06 #1
5 2434
I believe a querystring parameter is OK for this scenario. Make sure you take
malicious use of the querystring into account, I normally encrypt these
parameters and give them meaningless names like p1 rather tha ManagerID

HTH

David

"CharlesA" wrote:
Hi folks,
I'm having a discussion with my colleague about how to go about passing data
from one aspx page to another
example
On the main page I have a whole list of relationship managers with a
hyperlink that says 'customers' in each row for each manager and the
hyperlink contains a parameter for that manager and when the 'customers' page
is opened it checks that parameter via its querystring property

is this a bad thing to do?

is there a more generally well regarding method of passing the ID of that
manager to the 'Customers.aspx ' page

I think that querystrings are a perfectly respectable way to do this, my
colleague thinks that it will be slow and inelegant (and is mentioning things
such as server.transfer , server.redirect , which I don' t think are to do with
this kind of typical scenario)

any suggestions would be welcome!

thanks in advance for your help
CharlesA

Jan 12 '06 #2
The biggest problem with a querystring value is security, both in the sense
that it can't be used to pass secure information around and it can be
tampered. What if you don't want anyone to be able to put any ID in the
querystring? Of course, chances are you'd have a check on customer.aspx for
that anyways.

i think your colleague is dead wrong about performance. Querystrings tend to
be the most performant (did you know that isn't actually a word?) solutions.

With a querystring you have a link that goes to a different page
customer.aspx?i d=3 It will result in a typical GET, RESPONSE scenario.

To get server.transfer going, you are going to need to postback to the page
you are currently on and do the server.transfer . The postback itself is a
GET, RESPONSE and the server.transfer happens internally. The net result is
that this mechanism is the exact same for the client (oh, except they can't
bookmark the page they are now on), but on the server you've now had 2
init's, loads, 1 loadviewstate and rebuilt all the controls of the first
page just to hook into the event.

Sometimes you need to postback, say to finish some tasks before "leaving"
the page. Sometimes the power of storing values in the HttpContext and doing
a Transfer is absolutely necessary. But from the simple case you've
described, security concerns aside, querystring all the way.

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"CharlesA" <Ch******@discu ssions.microsof t.com> wrote in message
news:E7******** *************** ***********@mic rosoft.com...
Hi folks,
I'm having a discussion with my colleague about how to go about passing
data
from one aspx page to another
example
On the main page I have a whole list of relationship managers with a
hyperlink that says 'customers' in each row for each manager and the
hyperlink contains a parameter for that manager and when the 'customers'
page
is opened it checks that parameter via its querystring property

is this a bad thing to do?

is there a more generally well regarding method of passing the ID of that
manager to the 'Customers.aspx ' page

I think that querystrings are a perfectly respectable way to do this, my
colleague thinks that it will be slow and inelegant (and is mentioning
things
such as server.transfer , server.redirect , which I don' t think are to do
with
this kind of typical scenario)

any suggestions would be welcome!

thanks in advance for your help
CharlesA

Jan 12 '06 #3
I find a bit of this misleading.

Session variables aren't associated to size of data ("larger pieces"), but
rather time to live. They live throughout the entire visit, not a single
request. You don't use a session because there's a lot of data, you use it
'cuz you need it alive for the duration of the visit. Personally, I woudln't
even use it there, as it pins it in memory, I'd store it in the cache with a
userId key.

I think what you mean by Context Cache is actually the Context Items
collection. I only point that out because I think when most people hear
"cache" they think of the Cache object (which is available via the context,
Context.Cache).

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Spam Catcher" <sp**********@r ogers.com> wrote in message
news:Xn******** *************** ***********@127 .0.0.1...
"=?Utf-8?B?Q2hhcmxlc0E =?=" <Ch******@discu ssions.microsof t.com> wrote in
news:E7******** *************** ***********@mic rosoft.com:
I think that querystrings are a perfectly respectable way to do this,
my colleague thinks that it will be slow and inelegant (and is
mentioning things such as server.transfer , server.redirect , which I
don' t think are to do with this kind of typical scenario)


There are a couple ways to pass data between pages in ASP.NET:

Session Variables
Context Cache Variables
Querystring Variables
Cookies

Here's what I think:

Querystring are simple and allow bookmarking of the page.

Session Variables should be used to transfer larger pieces of data (i.e.
object data).

Context Cache variables is another option. They allow passing of data
between pages for 1 request (afterwards the context cache is cleared).
However, Context cache variables must use Server.Transfer . While
Server.Transfer technically is more efficent than a Reponse.Redirec t, the
end user does not see the page address change - thus the end user cannot
bookmark the page.

In your situation, I agree with you... Query Strings are nice and simple,
unless you're passing a bunch of data.

--
Stan Kee (sp**********@r ogers.com)

Jan 12 '06 #4
Thanks everyone for your speedy and helpful posts
much appreciated, especially the breadth and as I say again the speed with
which you all answered!

many thanks
CharlesA

to Karl, I didn't know that 'perfomant' wasn't a word, I've been using it
ever since I went to an incredibly interesting lecture by Ingo Rammer in
which he said that business objects are way more 'performant' than Datasets
in remoting scenarios...

Jan 12 '06 #5
That's ironic, I think I first found out when writing my article on business
objects vs datasets for MSDN :) My girlfriend poitned it out (she's my
first editor) and I had to rewrite some stuff because of her. I've since
reverted to using it!

http://msdn.microsoft.com/asp.net/de...CustEntCls.asp

Some trace it to the french word spelt the same meaning "efficient"

--
MY ASP.Net tutorials
http://www.openmymind.net/
"CharlesA" <Ch******@discu ssions.microsof t.com> wrote in message
news:EC******** *************** ***********@mic rosoft.com...
Thanks everyone for your speedy and helpful posts
much appreciated, especially the breadth and as I say again the speed with
which you all answered!

many thanks
CharlesA

to Karl, I didn't know that 'perfomant' wasn't a word, I've been using it
ever since I went to an incredibly interesting lecture by Ingo Rammer in
which he said that business objects are way more 'performant' than
Datasets
in remoting scenarios...

Jan 12 '06 #6

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

Similar topics

1
2038
by: Ronnie Patton | last post by:
Hello everyone can you help me find some information out about pros and cons using a global.asa in any asp application My co-works are saying its your choice to use one or not based on what the application does. but from what i have always been told and practiced was always use one. What we have is a order entry system for a call center about 200 users call comes in the user places the order customer care looks it up shipping ships it....
112
10366
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please, share your experience in using IDENTITY as PK .
0
1316
by: John Doe | last post by:
I have been given the task of figuring out if it would be better to purchase or develop a new system to replace the existing legacy unix system that is current in place. I am trying to do this as openly and honestly as possible due to it will also be my responsibility to help install and maintain this system for the long haul. It would be nice if anyone could reply with their pros or cons for such. The system will be a retail system...
5
7641
by: Fred | last post by:
Not much expertise on XSLT and trying to understand it's uses when creating apps in VS.NET? If I wanted flexibility on the UI (View aspect of M.V.C.): - How does it compare with creating business components that can be consumed by WebForms, WinForms, mobile devices, etc? Is it even fair to compare the such technologies? - How about for cases when you need to display dynamic elements on the form/grid (as compared to knowing data elements...
2
2821
by: scott | last post by:
Hi, Just wondering what sort of problems and advantages people have found using stored procedures. I have an app developed in VB6 & VB.NET and our developers are starting to re-write some of the code in stored procedures (im advocating encryption of them). When deploying an application however stored procedure seem to add another level of complexity to installation. In future we also plan to have an basic ASP app with some of the...
3
4230
by: Andrea | last post by:
Hello everyone, I'd like to know which are the main pros and cons of using XML implementation in business organizations. >From a technical perspective, I find XML powerful, but looks like it is being pushed more from technical people than from businessmen... So, some questions: 1. Pros and cons
3
19668
by: mcyi2mr3 | last post by:
can anyone explain to me what the pros and cons are of creating indexes on mysql tables. do they increase query speed? and if so at what cost? im thinking of using them for a large table i have which contains two text fields and may run into millions of records, is that advisable? regards marc
8
3376
by: dbarker1 | last post by:
This may be a can of worms but I wanted to throw it out here. I am gathering pros and cons for using querystring vs session variables for passing row keys in a ASP.net application. I want to be as thorough as possible so why not throw out this situation to the development community. Thoughts and opinions are appreciated.
7
3119
by: archimonde2 | last post by:
What are pros any cons to use eaccelerator and zend optimizer on php5-mod with apache2.2 ?? Does accelerators work immediately after install on all php files? When both are in use which accelerate speed execution of php files? How can i find that??
0
9643
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10315
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10085
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,...
0
9947
tracyyun
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...
0
6737
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();...
1
4045
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
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.