Need help with server side scripting.

P

Paul

HI! I have an iframe in which the iframe gets its height value from a
session variable. The value gets passed to the session ok because I am able
to display it but the main Iframe does not get updated with the new value
that has being passed to it. how can I accomplish this?

After the main page loads its height is at 620px. if a click on a link which
passes the value 1000, the variable does hold the new value 1000 BUT the
iframe height is still 620 if I do a view source. how can I update the
iframe value so it reloads using the new value?

I don't want to reload the whole page by doing a meta refresh either because
I have flash scene which I want to keep at it scene.

I was told that the page must be requested from the server in order to use
the session value or to see a change in
the value, since ASP is server-side technology.

Can someone give me an example on how I may use the way with the above
problem?

Example. The first Main page.----NOTE: ignore the ifp value its to set a
default page------------

<% Session("ifh") = Request.QueryString("ifh") %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<html>
<head>
<title>Untitled Document</title>
</head>
<body>

<%
dim ifp
ifp = Request.QueryString("ifp")
if ifp <> "" then
%>

<iframe src=<%= ifp %> id="Iframemain" name="Iframemain"
height="<%=Session("ifh")%>"
width="760px"></iframe>

<% else %>

<iframe src="Main_iframe_Pages/main.htm" id="Iframemain" name="Iframemain"
height="620" width="760" ></iframe>
<% end if %>

</body>
</html>
-------------End of main page.------------------------

From a menu link I pass the value like such.

Main_iframe_Pages/about_us.asp?ifh="1000"
 
R

Ronx

If you do not wish to reload the page, the iFrame resizing must be
done client-side, not using ASP. This means writing JavaScript to
resize the iFrame and redraw the page (and as a consequence the page
layout will change).
The link to the new page becomes something like
<a href="pagename.htm" target="Iframemain"
onclick="reSizeIframe(1000)">next page to display in Iframe</a>

The function reSizeIframe changes the Iframe height property, and
redraws the page. I have no idea whether this is actually possible or
not, but using ASP will require the entire page to be reloaded with a
different src and height for the iFrame - which would restart the
flash presentation.
 
S

Stefan B Rusynko

Your Iframe will never change size on the receiving page if you don't also pass ifp as a parameter, due to your
If statement value for ifp always being = ""
You are only passing ifh with Main_iframe_Pages/about_us.asp?ifh=1000 and not ifp
But you are checking for ifp with: if ifp <> "" then
- so what do you expect and where do you expect ifp to get a value from?

For your use neither should be a session variable, just a page variable as

Main_iframe_Pages/about_us.asp?ifp='someotherIframe.htm'&ifh='1000'

On the receiving end you just need
<%
dim ifp, ifh
ifp = Request.QueryString("ifp")
ifh = Request.QueryString("ifp")
if ifp <> "" then
%>
<iframe src=<%=ifp%> id="Iframemain" name="Iframemain" height="<%=ifh%>" width="760px"></iframe>
<% else %>
<iframe src="Main_iframe_Pages/main.htm" id="Iframemain" name="Iframemain"
height="620" width="760" ></iframe>
<% end if %>

IMHO
Passing an Iframe page URL as a parameter variable is risky because it is too visible
Could let me insert a URL of my own w/ some dangerous code in my iframe page

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
_____________________________________________


| HI! I have an iframe in which the iframe gets its height value from a
| session variable. The value gets passed to the session ok because I am able
| to display it but the main Iframe does not get updated with the new value
| that has being passed to it. how can I accomplish this?
|
| After the main page loads its height is at 620px. if a click on a link which
| passes the value 1000, the variable does hold the new value 1000 BUT the
| iframe height is still 620 if I do a view source. how can I update the
| iframe value so it reloads using the new value?
|
| I don't want to reload the whole page by doing a meta refresh either because
| I have flash scene which I want to keep at it scene.
|
| I was told that the page must be requested from the server in order to use
| the session value or to see a change in
| the value, since ASP is server-side technology.
|
| Can someone give me an example on how I may use the way with the above
| problem?
|
| Example. The first Main page.----NOTE: ignore the ifp value its to set a
| default page------------
|
| <% Session("ifh") = Request.QueryString("ifh") %>
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
| <html>
| <head>
| <title>Untitled Document</title>
| </head>
| <body>
|
| <%
| dim ifp
| ifp = Request.QueryString("ifp")
| if ifp <> "" then
| %>
|
| <iframe src=<%= ifp %> id="Iframemain" name="Iframemain"
| height="<%=Session("ifh")%>"
| width="760px"></iframe>
|
| <% else %>
|
| <iframe src="Main_iframe_Pages/main.htm" id="Iframemain" name="Iframemain"
| height="620" width="760" ></iframe>
| <% end if %>
|
| </body>
| </html>
| -------------End of main page.------------------------
|
| From a menu link I pass the value like such.
|
| Main_iframe_Pages/about_us.asp?ifh="1000"
| -----------------------------------------------
|
| Thanks in advance :)
|
| Paul
|
|
|
| --
| Thanks in advance :)
|
| Paul
|
|
 
P

Paul

HI! I have decided to take a client side approach as suggested.


Thanks for all the help :)

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top