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?id=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******@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.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