473,396 Members | 1,918 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,396 software developers and data experts.

transfer data from one asp page to second page

Hi, all! Need to transfer some data - 20 characters or less, from a first asp page that is called by a user submitting a form on an html page. What downloads from this first asp page is affected by what the user submits. Usually it includes another form which, when the user fills out and submits, calls a second asp page and this, after putting the data through a regex, stores it in a cgi-bin file. This all works: BUT I need to get some data from the first page to the second to be stored along with the data there.
I have tried hidden inputs on the form send down from the first page, and also including client-side javascript on it, it executes on the client side and could fill in a hidden input - but it doesnt know what data the server side asp/javascript has. Is there a way to send data from the first page directly to the second? Or a way to get the server-side asp/javascript to fill out the hidden input field on the form before it downloads?
The server I am using is www.sti.net, it runs asp and Jscript, so the first line of code is always:
<%@Language=JScript%>
and there then follows all the html containing the meta, title, css, and so on, then the <% and the Request.Form statements that receive the form upload from the user on the html page. That all works.
Hoping for some suggestions! Dave
May 11 '07 #1
8 2809
shweta123
692 Expert 512MB
Hi,

Try for the session variables though it may not be very effiecient
or the querystrings if the data is very less.
May 13 '07 #2
Hi,

Try for the session variables though it may not be very effiecient
or the querystrings if the data is very less.
Shweta,
This may sound stupid but I dont know what the session variables are, nor the querystrings.
I have another question,, and maybe the answer to it may give me a way to get the data from page to page. On the second page that I mention, I store data in a cgi-bin file. I use:
Expand|Select|Wrap|Line Numbers
  1.    filename=Server.MapPath("cgi-bin/myfile.txt");
  2.    fs=Server.CreateObject("Scripting.FileSystemObject");
  3.    replies=fs.OpenTextFile(filename,8,true);
  4.     replies.WriteLine(cleanqsubm);
  5.     replies.Close();  
and that appends a line of text onto the file, or creates the first line if the file is empty. NOW what I want to do is, at the beginning of the page, read that last line in to recover an order number from the previously stored line, to increment so that each line has its own orrder number. What code would I write to do that?
Hoping someone can help an asp neophyte,
Coachdave
May 18 '07 #3
shweta123
692 Expert 512MB
Hi,

Hope you still need this,
You can create session variable by
<%
Session(variablename)=value
%>
Now this variable can be referred on any of your asp pages.

Similarly querystring can be used while calling the page.
e.g. <a href=default.asp?var1="somevalue">GoNext</a>

For your second question,do you want to read the last line from the file and you are not able to do that?
Please refer this
Link
for File processing.
May 20 '07 #4
Hi,

Hope you still need this,
You can create session variable by
<%
Session(variablename)=value
%>
Now this variable can be referred on any of your asp pages.

Similarly querystring can be used while calling the page.
e.g. <a href=default.asp?var1="somevalue">GoNext</a>

For your second question,do you want to read the last line from the file and you are not able to do that?
Please refer this
Link
for File processing.
shweta123,
thank you for the informtion about FSO on that website classicasp.aspfaq. With the help of it, I was able to write code that could read from the file and extract the last line there. Right now I am struggling a problem trying to write to the file: I get 'permission denied, 800a0046' errors. Strange, I can read the file, and read AND write to another file. But not write to that one. I am corresponding with support on my ISP on that.
But, about the session variable: I tried that, I write
Session(transinfo) = qhname
where qhname is the information I have to transfer and transinfo is the name
of that information to use in the second asp page. BUT, I get the error
message: "transinfo is undefined".
If I can get the file reading and writing thing working I dont need the session variable here, but it would be nice to know how to make session variables work.
Dave
May 25 '07 #5
shweta123
692 Expert 512MB
Hi,
You are getting 'Permission Denied' may be because of Access Rights. Set the Write Acess on the folder in which file is residing.Also close the filesystem object as soon as you finish any Read or Write operation and then reopen it for the next operation.
For storing a value in a Session variable , write it like this
Session("transinfo") = qhname




shweta123,
thank you for the informtion about FSO on that website classicasp.aspfaq. With the help of it, I was able to write code that could read from the file and extract the last line there. Right now I am struggling a problem trying to write to the file: I get 'permission denied, 800a0046' errors. Strange, I can read the file, and read AND write to another file. But not write to that one. I am corresponding with support on my ISP on that.
But, about the session variable: I tried that, I write
Session(transinfo) = qhname
where qhname is the information I have to transfer and transinfo is the name
of that information to use in the second asp page. BUT, I get the error
message: "transinfo is undefined".
If I can get the file reading and writing thing working I dont need the session variable here, but it would be nice to know how to make session variables work.
Dave
May 27 '07 #6
shweta123,
I want to thank you for your help with the session variable thing. Using the quotes you specified, I was able to get data transferred from a first to a second page with session variables.
I still need to read the last line of a cgi-bin file in one of the applications I have, and I still have yet to hear from the 'network guys' at STI about why I am getting the
'permission denied' errors when I try to WRITE to the file. You mentioned checking the 'access rights' on the folder that the file is in, that would be cgi-bin on my server. How would I go about doing that?
Dave
Jun 1 '07 #7
shweta123
692 Expert 512MB
Hi,

You can put IUSR_<machine_name> user into Administrator group if your application security permits that. You can do this by Going into Computer Management/User/Right click Properties and Select appropriate group.
Also please refer this Thread
for more details.

Thanks
Jun 3 '07 #8
Shweta,
you are'nt going to believe this, but the 'permission denied' problem turned out to be just a stupid syntax error. I had
tcmfile=Server.MapPath(cgi-bin.myfile.... when it should have been
cgi-bin/myfile...
Anyway, the 'network guys' at sti finally got me straightened out on that.
I have another problem related to the first, and on the same asp pages. I want to send a short string to be stored on a cookie on the client's computer. I have javascript to write the cookie, and read it. My problem is getting the data from asp to the client-side javascipt.
What I have been doing, and it isn't working, is sending a form down to the client with a hidden input. The html is within Response.Write statements, because there are some conditions where I would not send the data down and write a cookie. So I have
var cookiedata=qname+ etc.
Response.Write("<form name='fame' method= etc. ");
Response.Write("<input type='hidden' name='fin' value=cookiedata />");
(note - no quotes around cookiedata.) then, after the %>,
<script type="text/javascript" language="javascript">
var cqname=document.fame.fin.value;
document.cookie="History="+cqname+"; expires etc.
but, what gets stored in the cookie is the word cookiedata, rather than the VALUE of cookiedata that asp had calculated.
So how can I get this method, or some other method, to work to get the snippet of data into the cookie?. Typically the data is 10-20 characters.
hthfys,
Coachdave
Jun 14 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Stefan Mueller | last post by:
I've a HTML page where you can add a lot of data to a dynamic table created with JavaScripts. At the moment this data is stored in a two dimensional array (JavaScript). But how can I transfer this...
0
by: Andrew | last post by:
Can someone out there help. I am using Server. Transfer from a user control to a webform and tried to follow many examples exactly as specified but cannot get around the (Specified cast is not...
11
by: Alexander Bosch | last post by:
Hi, I'm having a problem similar to the one that's stated in this KB http://support.microsoft.com/default.aspx?scid=kb;en-us;839521 When I'm posting a page to itself with the bool value as true it...
2
by: dee | last post by:
Hi I'm posting back to a second page using Server.Transfer(). There are buttons on this second page that use Respose.Redirect() since some of the pages are html's and the Transfer function cant...
0
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, Our asp programs seem to have different behaviors when users use IE and firefox. One of most annoying things is the data disappearing problem in IE but not in firefox.(Note: Sometimes a...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.