473,386 Members | 2,129 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,386 software developers and data experts.

Passing data through a Server.Transfer

Any ideas on how I can set some data in 1.asp, then have 1.asp do a
server.transfer (or .execute, come to that) to 2.asp, and have 2.asp
access the original data?

I'm aware that the Session object fits the bill but want to avoid using
this if I can. Having said that, the nature of the data is very much
per-user so things like the application object are definitely
inappropriate.

Another way I can do this is redirect/querystring, but the additional
roundtrip here is not attractive.

Any other (sensible) methods anyone can think of?

TIA,
Pete

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
7 2069
None using Server.Transfer etc, that I can think of. You might want to use
something along the lines of;

Page1.asp

<input type="text" name="myname" value="<%thetext%>">

Page2.asp

Dim thetext
thetext = Request.Form("thetext")

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Pete <an*******@devdex.com> wrote in message
news:#o**************@TK2MSFTNGP12.phx.gbl...
Any ideas on how I can set some data in 1.asp, then have 1.asp do a
server.transfer (or .execute, come to that) to 2.asp, and have 2.asp
access the original data?

I'm aware that the Session object fits the bill but want to avoid using
this if I can. Having said that, the nature of the data is very much
per-user so things like the application object are definitely
inappropriate.

Another way I can do this is redirect/querystring, but the additional
roundtrip here is not attractive.

Any other (sensible) methods anyone can think of?

TIA,
Pete

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
Nice idea. I should have added, though, that I don't want 1.asp to do
any UI at all.

The role of 1.asp is to kick off some back-end stuff (a db write, say),
the role of 2.asp is to render stuff. It's actually the result of the
"back-end stuff" that I want to pass through. So 1.asp writes data,
2.asp reads/displays data.

If you imagine a page with a form on it, for example. The form gets
posted to 1.asp, which takes care of storing the form to a database
(say). 1.asp then calls 2.asp, which displays something useful. So 2.asp
doesn't know/care about the form that was just submitted, but it might
need to be able to alert the user as to the success/failure of the
operation.

I'm aware, by the way, that I could do a .transfer to different pages
based on the result. But there could be many results, so that's just not
scalable.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
MDJ
Well, I don't think there's an issue with passing one or more variables in
the querystring then, it's certainly the way i'd do it if I wanted to avoid
cookies. Forget how 'attractive' it might be, although if you really want to
make the whole thing compact for compactness sake just put all your
functions into one page and control them with querystrings, form posts and
other variables in the page. A useful web application WILL in my experience
almost always use redirects from one place to another. I have little
experience with Server.Transfer but from the little I have I remember you
can't pass querystrings in it, just use Response.Redirect("page.asp?ID=" &
Request.Querystring("ID")) and <a
href="page.asp?ID=<%Request.Querystring("ID")%>">L ink</a> to maintain state.

"Pete" <an*******@devdex.com> wrote in message
news:eS***************@tk2msftngp13.phx.gbl...
Nice idea. I should have added, though, that I don't want 1.asp to do
any UI at all.

The role of 1.asp is to kick off some back-end stuff (a db write, say),
the role of 2.asp is to render stuff. It's actually the result of the
"back-end stuff" that I want to pass through. So 1.asp writes data,
2.asp reads/displays data.

If you imagine a page with a form on it, for example. The form gets
posted to 1.asp, which takes care of storing the form to a database
(say). 1.asp then calls 2.asp, which displays something useful. So 2.asp
doesn't know/care about the form that was just submitted, but it might
need to be able to alert the user as to the success/failure of the
operation.

I'm aware, by the way, that I could do a .transfer to different pages
based on the result. But there could be many results, so that's just not
scalable.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4
Why not do it all in one asp code?
-dlbjr

Discerning resolutions for the alms
Jul 19 '05 #5

I would do the form thing with hidden fields and do the javascript
thing to auto-submit the form ... let me know if you want a sample
javascript.

You may want to consider the very rare case that someone may have
javascript off or something and have a "if this doesn't redirect,
click here" image to submit.

Brynn
www.coolpier.com

On Wed, 07 Jan 2004 04:49:51 -0800, Pete <an*******@devdex.com> wrote:
Nice idea. I should have added, though, that I don't want 1.asp to do
any UI at all.

The role of 1.asp is to kick off some back-end stuff (a db write, say),
the role of 2.asp is to render stuff. It's actually the result of the
"back-end stuff" that I want to pass through. So 1.asp writes data,
2.asp reads/displays data.

If you imagine a page with a form on it, for example. The form gets
posted to 1.asp, which takes care of storing the form to a database
(say). 1.asp then calls 2.asp, which displays something useful. So 2.asp
doesn't know/care about the form that was just submitted, but it might
need to be able to alert the user as to the success/failure of the
operation.

I'm aware, by the way, that I could do a .transfer to different pages
based on the result. But there could be many results, so that's just not
scalable.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 19 '05 #6
MDJ
Why not. It just depends how the programmer likes to arrange his/her
application.

"dlbjr" <do******@do.u> wrote in message
news:uc*************@TK2MSFTNGP09.phx.gbl...
Why not do it all in one asp code?
-dlbjr

Discerning resolutions for the alms

Jul 19 '05 #7
Sorry, but when you're a user in Hong Kong waiting several tens of
seconds for a web server in London to serve you a page across a crappy
wan, performance is definitely an issue. And to keep performance
optimal, the fewer round trips you make the better, which means avoiding
response.redirect where you can.

I'd venture to suggest that this kind of thing should be a concern even
if you're not aiming at a particularly slow network. There are
circumstances for using response.redirect but I don't believe it should
be a first choice.

The idea of a single asp page is one I'd thought of, but I just want to
keep the granularity of a single page doing a single thing. If you know
Java, think of the way you'd traditional split a servlet and a jsp. But
I agree it's possible to do things this way - it's even possible to keep
the granularity just by adopting a #include approach, albeit this way is
a bit of a fudge. We may end up going this way.

I did try cookies - 1.asp would set a cookie and call .transfer, 2.asp
would load (2.asp can't see the cookie - I tried this) but with an
onload event getting executed client-side script to look inside the
cookie and do its stuff. And this worked, only problem was once the
cookie was there it was difficult to (100% reliably) get rid of the
blooming thing!

Thanks for the responses. I think it'll either be a single page, or a
case of Sod this I'm turning on the session object!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #8

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

Similar topics

1
by: Jim Mitchell | last post by:
I have one ASPX page that calls another using server transfer as shown below. The problem is that I do not get the cookie in the second page. The value seems to be blank. Any help would be...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
7
by: Anne | last post by:
hie there, i want to be able to pass multiple parameters to another page. currently, i am able to do so, but somehow i feel it is not the correct way to do it. below is part of what i have so far....
5
by: cgia | last post by:
I am porting an old client/server application to asp.net. I used to retrieve data into local tables (Paradox table-files on the client's disk) and work on them before saving them back to the...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
1
by: Troy | last post by:
Hello, I'd like to pass data between two pages but unable to get code to work. Code is below and any help is appreciated: ...
1
by: Eric | last post by:
Hello, I am trying to come up with the best way to pass large amounts of data from page to page, namely a data table. The user needs to enter data into a form in one page and confirm it on...
1
by: olduncleamos | last post by:
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...
8
by: Chris | last post by:
Hi, I have two froms (form1 and form2). I want to be able to pass values from form 1 to form2 and be able to use those values leter in form2. This is my code for form1 Private Sub...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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.