Thursday, March 29, 2012

Passing Values and Server.Transfer

Hello all.
With a background in ASP, I am finding the work required for passing
values between pages mystifying. For various obvious reasons, I have
eliminated using cookies and session to store state data. The only
ASP.NET options left is to use the Server.Transfer to transfer to page
2 from page 1, and then use the context to get whatever values in page
1 from page 2. I do find this indeed a very elegant solution as now I
can pass objects instead of plain text values.
But the problem is with the out of sync URL when using
Server.Transfer. I am scratching my head as to how anybody can not see
this as a problem. Not only the URL being display is not the same as
the page that you are seeing, it is also consistently one step behind
in a wizard-like sequential pages environment. Is it not confusing as
hell for the users?
Is there a better way to handle such a basic infrastructure problem
(passing values between pages), or am I just stuck in the old ASP
thinking?
Thanks in advance.> But the problem is with the out of sync URL when using
> Server.Transfer. I am scratching my head as to how anybody can not see
> this as a problem. Not only the URL being display is not the same as
> the page that you are seeing, it is also consistently one step behind
> in a wizard-like sequential pages environment. Is it not confusing as
> hell for the users?
Yeah, but the url showing is the url that the browser posted to. Server.Tran
sfer
is all done server side and thus the browser really doesn't know that the
second page is the one that did the rendering. In ASP.NET 2.0 they've introd
uced
cross page postbacks which is the prefered way to accomplish what you're
doing. I posted about this, FWIW:
http://staff.develop.com/ballen/blo.../>
3b8b4f29eaf
-Brock
DevelopMentor
http://staff.develop.com/ballen

0 comments:

Post a Comment