Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a recordset to another ASP page?

Status
Not open for further replies.

efrost2

Programmer
Jul 18, 2001
50
US
Is it possible to pass a disconnected recordset from one ASP page to another?
Thanks
 
of course it is, u can use Session VAriables for that.

biggie
 
Don't forget, the session expires in 20 minutes, so you have to treat this case, too. Verify if the variables exists whae you use them by comparing them with "" string.


Hope this helps, s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darkness...
 
Try to use Server.Transfer function

Here is some help...

When you call Server.Transfer, the state information for all the built-in objects will be included in the transfer. This means that any variables or objects that have been assigned a value in session or application scope will be maintained. In addition, all of the current contents for the request collections will be available to the .asp file receiving the transfer.

If the path you specify in the input parameter is for an .asp file in another application, the .asp file will execute as if it were in the application that contains the Server.Transfer command. In other words, all variables and objects that have been given application scope either by other .asp files in the application or by the application's Global.asa file will be available to the called .asp file. However, the path parameter must not contain an query string or ASP returns an error.

Server.Transfer acts as an efficient replacement for Response.Redirect. Response.Redirect tells the browser to request a different page. Since a redirect forces a new page request, the browser has to make two round trips to the Web server, and the Web server has to handle an extra request. IIS 5.0 introduced a new function, Server.Transfer, which transfers execution to a different ASP page on the server. This avoids the extra round trip, resulting in better overall system performance, as well as a better user experience.

Example
The following example demonstrates transferring from one .asp file to another, as well as sending the session identifier to the client.

The output from these scripts will be:

A session ID

I am going to ASP2

The same session ID

ASP1

<HTML><BODY><% Dim sessvar1 Response.Write Session.SessionID
Response.Write (&quot;<BR>&quot;)
Response.Write(&quot;I am going to ASP2 <BR>&quot;)
Server.Transfer(&quot;/Myasps/ASP2.asp&quot;)
%>

ASP2

<HTML>

<BODY><% Response.Write Session.SessionID %></BODY></HTML>

________

George
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top