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!

How do you Pass data from .asp to .csp page

Status
Not open for further replies.

seanmahabadi

Programmer
Nov 19, 2003
3
US
I have an application created with .asp pages with interdev. I am incorporating Crytal Enterprise 8.5 for my reporting needs. I have used the Crystal Report Wizards for creating the reporting environment. I would like pass a session variable from my asp enviroment to a csp page to be used as a paramenter in a report. Is there a trick for passing data from an .asp page to a .csp page.

first of all I thought I could access a session variable, but it seems like in the .csp pages I can't see the session variables that were set up on the .asp side.

So then I figured I would pass the data I need through the hyperlink. On my main menu the link that launches the reports. so my href would read: default.csp?UserID=123

I use this method all time between my .asp pages , but from .asp to .csp nothing comes accross.

Any help on this topic would be appreciated.
 
Hi,
I use that method ( as well as using FORM items) on most ( if not all) my CSP and ASP pages to pass info ...

On your CSP page does your
Request.QueryString.Item("UserID") properly get the value?
Try a
Code:
 Response.Write(Request.QueryString.Item("UserID"))
to see what was actually passed.


hth,
[profile]
 
Thanks for the reply Turkbear. Yes I tried the request.querystring and nothing comes across. Have you done this from .asp to .csp ?

Here's exactly what I'm doing.

On my main menu (asp) I have a link called "Reports" - the href of Reports redirects to:
Reports/Default.csp?UserID=57
the user id obviously is dynamic)

So now in Default.csp we have the code
UserID = Request.QueryString.Item("UserID")
But nothing has come across

any thoughts ???
 
Hi, Yes I use a combination of CSP and ASP pages and send 'stuff' between them - I use a JavaScript function, for instance, on an ASP page, to open a new window and call a CSP page with passed parameters:
Code Snippets Follow

Code:
 reportWindow = window.open("empviewerV3.csp?qid=" + pstr + "&progid=" + progid + "&rid=" + m + "&invr=" + istr,"rptWindow",windowprops);

The empviewer3.csp page then processes the passed variables:
Code:
action = "viewrpt.cwr?id=" + Request.QueryString.Item("rid") + Request.QueryString.Item("qid") + "&init=" + Request.QueryString.Item("invr") + Server.URLEncode(":connect");


As to why yours does not work, it is hard to say:
Try building 2 simple pages:
1: an asp page that just accepts a numeric value and calls the second ( csp ) page with a ?PassedValue=999 ( or whatever)..
This CSP page just has a
Response.Write(Request.QueryString.Item("PassedValue"));
on it..

That way all other variables ar eliminated so it will be easier to debug.


[profile]
 
Thanks Turkbear.
The problem wasn't .asp & .csp afterall

Since I used the wizard to set up the entire reporting environment. Some ugly convoluted code was throwing me way off. After tracing through it I found the problem.

Serves me right for trying to take a short cut and use a wizard.
 
I would like to bring to your attention the following description taken from Easton's 1897 Bible Dictionary :

Wizard: a pretender to supernatural knowledge and power, "a knowing one," as the original Hebrew word signifies. Such an one was forbidden on pain of death to practise his deceptions.

Quite fitting, I think......[wink]

Reebo
UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top