PDA

Click to See Complete Forum and Search --> : Using a variable that has been calculated by another frame page


Oct 11th, 2000, 05:00 PM
Hello there, I have a very big problem and at this point I'm wondering if there's any way around it. I'm using a footer frame page on Microsoft Front Page to write an asp program.
My problem is that I use this page to do some calculations by calling it like this: parent.footer.document.location=" activepage.asp?data1=1&data2=2".

Now at the footer page level I do some calculation and a variable is set to a specific value. Let's call the variable 'Result'.

This is the codes I've tried to use to get Result from my footer page:

<script language="vbscript">
if selection.options(selection.selectedIndex).value = "Get Result" then
parent.footer.document.location = "activepage.asp?data1=1&data2=2"
msgbox "The result is being calculated"
checking = <%=Result%>
document.write "The result is " &checking
</script>


Provided that my select pull down menu has been properly declared, I noticed that there's no way to pass the data from my Footer page to my Main page. I was told it is due to the fact that there's no way to tell how long the Footer page will take to load. So what I did is prompting the user with a message box to allow the loading to complete. But even then I'm still not able to read the Result value. If you have some time you can check it real quick with a footer frame page with Microsoft Front Page and you'll see for yourself.

I'd be glad to hear back from you with your comments on this one.

monte96
Oct 11th, 2000, 11:38 PM
You will find that you have to pass the value back to the main page the same way you passed them to the footer. Using querystrings. You could use a session variable but then the main page will not know when to refresh and get the new data.

Since the other page is out of scope there is no way to access variables or functions that are declared on it directly. The page will need to reload, do it's processing and in turn reload the calling frame, passing a querystring with the result back.

Also, never EVER use msgbox on an ASP page. It runs on the server not the client browser and will stop your web app cold since the server is normally unattended and a msgbox is typically modal.