View Full Version : Passing data between frames
Wudang
3rd April 2004, 07:24 AM
At work I'm presenting some stats from my system via a web page. What I've done so far is create a web page which has an iframe whose SRC is an ASP file. The HTML file has column headings to make sense of the column data in the iframe so the columns can be scrolled but the headers are still visible. What I want to add now is FORM on the HTML that will supply a date range to the ASP file. What I'm having trouble doing now is passing that date range to the ASP. I've tried Session variables Querystring but neither seem to allow the asp to inherit the values. Ideally I'd like to keep my webpages (this is a template for more) as standards compliant as possible. Any suggestions?
Here's the content of my iframe tag
iframe class="tabContent" name="myIframe"
src="Cicstaskstat.asp"
Comments such as "an iframe is the wrong place to start" perfectly welcome. I have 2 goals, scrollable columns with visible headers and standards compliant.
In case relevant - this is on an NT server running IIS. Yeah like I get to choose the software.
Yahweh
3rd April 2004, 08:54 AM
You want your main page to look like this:
<form action="Cicstaskstat.asp" target="myIframe">
Name: <input type="Text" name="MyName">
Password: <input type="Password" name="MyPassword">
Other Form Elements: <input type="Text" name="SomeElementName">
</p>
Date of Article: <input type="Hidden" name="MyDate" value="<%=FormatDateTime(Date, vbLongDate)%>">
</p>
</form>
To get the Form Values, you use this code in ASP displayed in IFRAME:
<%
MyName = request("MyName")
MyPassword = request("MyPassword")
AnotherVariable = request("SomeElementName")
TodaysDate = request("MyDate")
%>
When passing form values, you do not need to specificy request.form or request.querystring, instead you can remove ".form" and ".querystring". Gathering values can be done with Request("name of form element here") which is compatible with both form methods.
Iconoclast
3rd April 2004, 10:05 AM
Originally posted by Wudang
I have 2 goals, scrollable columns with visible headers and standards compliant.
In case relevant - this is on an NT server running IIS. Yeah like I get to choose the software. Rather than using an IFrame, have you considered a scrollable DIV; set it's "width" and "height" to define the size of the scrollable area and specify "overflow-y:scroll" as part of it's style. That way all your data is on a single ASP page.
Wudang
3rd April 2004, 11:24 AM
Originally posted by Iconoclast
Rather than using an IFrame, have you considered a scrollable DIV; set it's "width" and "height" to define the size of the scrollable area and specify "overflow-y:scroll" as part of it's style. That way all your data is on a single ASP page.
Oh - interesting. I'll read up on it. I have too many books and too little time. Thanks.
Wudang
5th April 2004, 05:07 AM
Thanks both of you. I usually buy reference-type books for computing but since every time I did a webpage I though they looked amatuerish, this time I bought a couple of design books instead. My pages look prettier but there are some fundamental issues about CSS2 etc I just haven't "got". Time for yet another book.
cheers
© 2001-2009, James Randi Educational Foundation. All Rights Reserved.
vBulletin® v3.7.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.