Apart from using sessions, what is the best way of remembering values when moving from one screen to another.
Printable View
Apart from using sessions, what is the best way of remembering values when moving from one screen to another.
I would go for session. But if that is not avail... you can always use the hidden input types and pass the values page to page.
I had to do that ... pass the value page for page. It's tedious... but keeping all the names the same is becomes a breaze..
You can probbly store it in a cookie... but if cookies are disabled your are up the creek!
Hope it helps:)
If cookies are disabled, you are up a creek with sessions as well..
Partly an answer to one of your other questions. If you are using Frames you can store values on the main frame page:
You can access these variables in JavaScript by:Code:<script LANGAUGE = "JavaScript">
var custName = "";
var custNumber = 0;
</script>
parent.custName;
parent.custNumber;
From any other of pages in the other frames.
But if you are using ASP, Session variables are much better.
Chris
An easier way then through hidden fields would be to pass it through the querystring. Of course, if you have secure information (passwords, credit card numbers, etc.) then you want to use the hidden fields. Of course, this means you have to submit a form on every page, kind of a pain in the a$$
Hidden field values can be viewed in the page source.
Right I've got information going between frames storing common info in the title frame which is always there. Next trouble is, is there anyway to get info from Javascript to ASP.
You could put a session id in the URL or Querystring and write it in every link once the user starts. It's a very limited method, though - if they click to another site you lose the session.
You could try using the querystring through a javascript function. Create a function like:
function sendInfo(){
window.location = 'http://myAspScript.asp?info=' + parent.myVar;
}
Call the function whenever you want to navigate to the asp script.
<a HREF = "javascript:sendInfo();">Click Here</a>
<input TYPE = "button" VALUE = "Click Here" ONCLICK = "sendInfo();">
Chris