Passing URL parameter to a frameset / and all pages in frameset

Hey there again guys,

This may sound like a strange question but I was wondering… I have a frameset that has three columns. Each page in these columns is a dynamic ASP pages that pull different information from the database about the same set of information. For example, frame 1 has images of each website I have designed, when clicked frame 2 displays all the images for that site, one at a time in a repeat region. They can scroll through each image and see text for each image in this frame. At the same time when the image in frame 1 is clicked frame 3 loads the selected sites description and general information. You can see what I am trying to do here: http://home.comcast.net/~duncan-e/websites/Portfolio/frameset.html

Now here is the thing. The pages in the frameset will be all dynamic, right down to the header image. What I want to do is pass a URL parameter from the http://home.comcast.net/~duncan-e/websites/Portfolio/index.html page to the frameset.html page, and then have the frameset load all the respective pages with the given URL parameter. Can this be done and if so how?! Any better ideas welcome.

Thanks
LVL 2
NugsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
One easy way is to use a bit of javascript

<script language=javascript>
function changeframe(source){
parent.framename.location.href="displaypage.asp?url=" & source }
</script>

Then in frame one for each picture surround with an hyperlink
<a href="javascript:changeframe('<%=source%>')" STYLE='text-decoration: none'>
<img src="">
</a>
Just pass the site variable into the href tag as 'source', I'm assuming the filename is the same but you just pass in a variable to tell it which site to display.
The same methodology applies to frame 2 to change frame 3's source.


Also please maintain your old open questions, some go back quite some time.
0
NugsAuthor Commented:
No, maybe I didn't explain the question well enough but i don't think that helps me.

From the main page (index.asp) I am passing two URL parameters. I.e. when the user clicks on Web Design the link reads something like this: portfolio.asp?projCode=ias&sectCode=web. Each project I have done has a id, projCode is the field that holds this. sectCode is the category or section the project is in like Web or Print, etc… Portfolio.asp is the frameset page and looks like this:

<%@LANGUAGE="VBSCRIPT"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="*" cols="560,*" framespacing="0" frameborder="NO" border="0">
  <frameset cols="189,*" frameborder="NO" border="0" framespacing="0">
    <frame src="left.asp?SectCode=web" name="leftFrame" scrolling="NO" noresize>
    <frameset rows="130,*" frameborder="NO" border="0" framespacing="0">
            <frame src="header.asp?SectCode=web" name="topFrame" scrolling="NO" noresize>
            <frame src="main.asp?projCode=ias" name="mainFrame" scrolling="auto" noresize>
      </frameset>
  </frameset>
  <frameset rows="61,*" frameborder="NO" border="0" framespacing="0">
            <frame src="searchpanel.asp" name="topFrame1" scrolling="NO" noresize>
            <frame src="right.asp?projCode=ias" name="rightFrame" scrolling="auto" noresize>
  </frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>

As you notice I have put the URL parameter for each frame in there manually. What I need this frameset page to do is pull the URL parameters that the index page passes and place them where I have placed the above URL parameters… Make sense?

Nugs

PS: my other questions questions have not been answered
0
GaryCommented:
I don't see the problem, my solution does exactly what you want.  Your main page that sets the frames above is fine as it is.  
Frame one loads as a default since all its doing is displaying the webs and so the data there is static and doesn't change - correct?  So you loop through the images that are displayed for each web site and set the href tag to main.asp and dynamically put in the appropriate variables to pass to frame 2 e.g.
<a href="javascript:changeframe('<%=rs("ias")%>','<%=rs("web")%>)" STYLE='text-decoration: none'>
<img src="">
</a>
Along with the javascript
<script language=javascript>
function changeframe(ias,web){
parent.framename.location.href="portfolio.asp?ias=" + ias +"&sectcode=" + web}
</script>
So on the onclick event of the href tag of the web images the javascript function gets called and changes the location of frame 2 to portfolio.asp and also passes the two variables to it.  So in the page that is loaded in frame 2 you just call these two variables and build the page accordingly.  

Heres a simple example,  if this totally off then sorry I don't understand what you mean at all
http://www.intouchmedialtd.com/frame/frame.html
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

NugsAuthor Commented:
I can easily controll the other frames from the webs frame on the left. What i am trying to do is initialy set each frames pages with the URL parameter that corosponds to the section they selected (Web Design, Print, etc...) Essentialy i need the frameset to be dynamic and pass the url parameters to each page in the frameset accordingly.

Could you explain the javascript above, maybe this is the solution and i am not understanding.

Nugs
0
NugsAuthor Commented:
All i bassicly need is to figure out how i basicly get the frameset page to check the current URL, see what the value for sectCode and projCode are and then set  the Left and Top frame with the sectCode parameter and the Main and Right frames to load there pages with the projCode URL parameter. Thats all...
0
GaryCommented:
Ok so from the querystring we get
<%
sectCode=request("sectCode")
projCode=request("projCode")
%>
Then your frame line becomes
<frame src="left.asp?SectCode=<%=sectCode%>" name="leftFrame" scrolling="NO" noresize>
Same applies for all frame sources.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NugsAuthor Commented:
I actualy got it working last night. i simply added two recordsets to the frameset and that seems to do the url parameter filtering fine. code looks something like this now:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/portfolioConn.asp" -->
<%
Dim LeftCont__MMColParam
LeftCont__MMColParam = "1"
If (Request.QueryString("SectCode") <> "") Then
  LeftCont__MMColParam = Request.QueryString("SectCode")
End If
%>
<%
Dim LeftCont
Dim LeftCont_numRows

Set LeftCont = Server.CreateObject("ADODB.Recordset")
LeftCont.ActiveConnection = MM_portfolioConn_STRING
LeftCont.Source = "SELECT * FROM SectionSlides WHERE SectCode = '" + Replace(LeftCont__MMColParam, "'", "''") + "'"
LeftCont.CursorType = 0
LeftCont.CursorLocation = 2
LeftCont.LockType = 1
LeftCont.Open()

LeftCont_numRows = 0
%>
<%
Dim Header__MMColParam
Header__MMColParam = "1"
If (Request.QueryString("SectCode") <> "") Then
  Header__MMColParam = Request.QueryString("SectCode")
End If
%>
<%
Dim Header
Dim Header_numRows

Set Header = Server.CreateObject("ADODB.Recordset")
Header.ActiveConnection = MM_portfolioConn_STRING
Header.Source = "SELECT * FROM SectionHeader WHERE SectCode = '" + Replace(Header__MMColParam, "'", "''") + "'"
Header.CursorType = 0
Header.CursorLocation = 2
Header.LockType = 1
Header.Open()

Header_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<frameset rows="*" cols="560,*" framespacing="0" frameborder="NO" border="0">
  <frameset cols="189,*" frameborder="NO" border="0" framespacing="0">
    <frame src="left.asp?sectCode=<%=(LeftCont.Fields.Item("SectCode").Value)%>" name="leftFrame" scrolling="NO" noresize>
    <frameset rows="130,*" frameborder="NO" border="0" framespacing="0">
            <frame src="header.asp?sectCode=<%=(Header.Fields.Item("SectCode").Value)%>" name="topFrame" scrolling="NO" noresize>
            <frame src="blank.asp" name="mainFrame" scrolling="auto" noresize>
      </frameset>
  </frameset>
  <frameset rows="61,*" frameborder="NO" border="0" framespacing="0">
            <frame src="searchpanel.asp" name="topFrame1" scrolling="NO" noresize>
            <frame src="blank.asp" name="rightFrame" scrolling="auto" noresize>
  </frameset>
</frameset>
<noframes><body>
</body></noframes>
</html>
<%
LeftCont.Close()
Set LeftCont = Nothing
%>
<%
Header.Close()
Set Header = Nothing
%>


Thanks for your advice,
Nugs
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.