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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can you use ASP to manipulate a frameset?

Status
Not open for further replies.

scroce

MIS
Nov 30, 2000
780
US
my observation up to this point tends to point towards "no"

What I'm trying to do is get the page in top portion of the frameset to check the value of a combo box, go into a database, fetch the appropriate file name based on what the user has chosen, and stick that filename into the src of the bottom frame, thus showing the file the user has chosen in the combo box in the top part.

I'm trying to do it like this:

dim strIssueDate
dim strIssueFileName

strIssueDate = Request.Form ("lstIssueDate")' This comes from the top half of the frame

dim cnConnect
dim rsInsight
dim strSQL

Set cnConnect = server.CreateObject("ADODB.Connection")
cnConnect.Open Application("DatabaseConnect")

strSQL="SELECT tblInsight.InsightDate, tblInsight.InsightFileName "
strSQL = strSQL & "FROM tblInsight "
strSQL = strSQL & "WHERE Insight.InsightDate =#" & strIssueDate & "#;"

Set rsInsight = server.CreateObject ("ADODB.Recordset")

rsInsight.Open strSQL, cnConnect
strIssueFileName=rsInsight("InsightFileName")
%>

<frameset rows=&quot;175,*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;>
<frame name=&quot;topFrame&quot; scrolling=&quot;NO&quot; noresize src=&quot;InsightTopNav.asp&quot; >
<frame name=&quot;mainFrame&quot; src=&quot;<% =strIssueFileName %>&quot;>
</frameset>
<% 'rsInsight.Close %>
<noframes><body bgcolor=&quot;#FFFFFF&quot;>
</body></noframes>
</html>


The problem seems to be that strIssueDate keeps coming up empty causing my SQL to blow up. I don't think the frameset is evaluating the request.form(&quot;lstIssueDate&quot;) statemnt. I also tried using a querystring, and that did'nt work either. I further observe that if you put a manual date entry in place of my variable strIssueDate, it seems to work.

Can someone confirm or refute my hypothesis? or tell me what I'm doing wrong- maybe I need to be using javascript???








Ah say, there's somethin' a little &quot;eeeeeeee&quot; 'bout a boy who don't like basbawl...
 
Yes that is perfectly legitimate. Your variable is empty because the previous page did not send the parameter to your new page.

-pete


 
On your form in the top frame is the target set to send to the bottom page?
 
so just to make doubly sure, I can safely assert that you cannot post data to a frameset page and expect to be able to manipulate it, like this:

Code:
(this tag would be in a file called myform.asp)

<form name=frmIssueDate method=&quot;post&quot; action=&quot;MyFrameSet.asp?var=hello&quot;>

in MyFrameSet, I can't use ASP to call a request.querystring, or a request.form to change the frameset.


so then, does anyone know an alternate way of accomplishing the desired effect?

thanks


Ah say, there's somethin' a little &quot;eeeeeeee&quot; 'bout a boy who don't like basbawl...
 
lesleint,

as a tribute to how clueless I am about frames, how would I verify that?

Ah say, there's somethin' a little &quot;eeeeeeee&quot; 'bout a boy who don't like basbawl...
 
Code:
<form name=frmIssueDate method=&quot;post&quot; action=&quot;MyFrameSet.asp?var=hello&quot; target=&quot;BottomFrame&quot;>
 
>> I can't use ASP to call a request.querystring, or a
>> request.form to change the frameset.

Well you keep saying that even though we are telling you that you CAN do it.

Here is what i posted:
Yes that is perfectly legitimate

your problem is here:
<form name=frmIssueDate method=&quot;post&quot; action=&quot;MyFrameSet.asp?var=hello&quot;>

you post the form but you put the variable in the querystring, then in your ASP code:
strIssueDate = Request.Form (&quot;lstIssueDate&quot;)

you only look for it in the Form variables, so this should work better:
Code:
strIssueDate = Request(&quot;lstIssueDate&quot;)

-pete


 
palbano,

ok - sorry i misunderstood your post. Here's the way it looks now

on my form submit page, I did:
Code:
<form name=frmIssueDate method=&quot;post&quot; action=&quot;InsightFrame.asp&quot;>

<select name=&quot;lstIssueDate&quot;>
<%call InsightIssues() %> 'the choices come from a table in a database
</select>
on InsightFrame.asp, I have:
Code:
dim strIssueDate
dim strIssueFileName

strIssueDate = Request.Form (&quot;lstIssueDate&quot;)

dim cnConnection 'connection to database
dim rsInsight 'recordset to hold info queried from tblInsight 
dim strSQL 'variable to hold the SQL statement to fetch Issue records

Set cnConnection = server.CreateObject(&quot;ADODB.Connection&quot;)
cnConnection.Open Application(&quot;DatabaseConnect&quot;)

'Raw SQL Statement
 'SELECT tblInsight.InsightDate, tblInsight.InsightFileName
 'FROM tblInsight
 'WHERE (((tblInsight.InsightDate)=#4/4/2003#));


strSQL=&quot;SELECT tblInsight.InsightDate, tblInsight.InsightFileName &quot;
strSQL = strSQL & &quot;FROM tblInsight &quot;
'strSQL = strSQL & &quot;WHERE tblInsight.InsightDate=#4/4/2003#;&quot;
strSQL = strSQL & &quot;WHERE tblInsight.InsightDate='#&quot; & strIssueDate & &quot;'#;&quot;

Set rsInsight = server.CreateObject (&quot;ADODB.Recordset&quot;)

rsInsight.Open strSQL, cnConnection
strIssueFileName=rsInsight(&quot;InsightFileName&quot;)

'Here's the frameset:


%>

<frameset rows=&quot;175,*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;> 
  <frame name=&quot;topFrame&quot; scrolling=&quot;NO&quot; noresize src=&quot;InsightTopNav.asp&quot; >
  <frame name=&quot;mainFrame&quot; src=&quot;<% =strIssueFileName %>&quot;>  
</frameset>
<%  'rsInsight.Close  %>
<noframes><body bgcolor=&quot;#FFFFFF&quot;>
</body></noframes>
</html>
[code]
[COLOR=green] - and it still doesn't work.  I agree with you, I see no reason why it isn't a perfectly legit.  thing to do, but I just can't see why it's not working.  strIssueDate appears (if I'm not mistaken) to be coming up empty - If you comment in the code that puts in a literal date, it works fine[/color]


Ah say, there's somethin' a little &quot;eeeeeeee&quot; 'bout a boy who don't like basbawl...
 
scroce,

Ok i'm going to yell to get your attention, but don't take it the wrong way.

READ THE POST... ACTUALLY READ IT

You have still not implemented the solution that my previous post details.

-pete

 
i have read your post, but I am still unclear.

I don't want to have to use a querystring. I was just using that to test to see if that worked as well. (which it doesn't either - it's like the frameset page doesn't recognize anything submitted to it)

I'd rather request the value directly off of the lstFormSelect combo box on the submitting page

So I think you suggested to try:

strIssueDate = Request(&quot;lstIssueDate&quot;)

instead of:

strIssueDate = Request.Form(&quot;lstIssueDate&quot;)

Niether of those work. Your assertion:

Your variable is empty because the previous page did not send the parameter to your new page.

is certainly correct. Although it still doesn't work, and I still can't figure out why. It should be a simple submitting of values and then a requesting of those values from the page that houses the frameset.

So I know I must be missing something really basic, since the general consensus is that this IS indeed possible.

It could also be that I've just been looking at this too long.

Ah say, there's somethin' a little &quot;eeeeeeee&quot; 'bout a boy who don't like basbawl...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top