|
 |
asp_web_howto thread: server.execute inside a frame
Message #1 by "Pham, Khanh" <Khanh.Pham@d...> on Mon, 11 Mar 2002 12:53:05 -0500
|
|
I hope someone can help with this problem.
My division is putting together an intranet department wide. I have a
header with a our logo and a global navigation on every page. Another
division wants their pages inside a frame with their our header on the top
frame. What I want to do is when a page is inside a frame to just leave it
alone. When a page is not in a frame for my header to be added. I was able
to get the most part of it to work. The only problem is you have to refresh
the page to get the header to work outside a frame or refresh within a frame
to remove the header. I use Javascript to determine if the page is in a
frame and set a cookie value. Then use asp to check that cookie and perform
a server.execute to add the header if necessary. Below is my test page.
Any advice will be helpful.
<html>
<head>
<TITLE>Services</TITLE>
<LINK href="/intranet/includes/intranet.css" type=text/css rel=stylesheet>
<script language="JavaScript">
if (top.location == location) {
document.cookie = "inFrames=no";
}
else{
document.cookie = "inFrames=yes";
}
//window.location.replace = "cs1.htm"
</script>
</head>
<BODY topmargin="0" leftmargin="5">
<%
'-------------------------------------------------
if Request.Cookies("inFrames") = "no" then
server.Execute "/intranet/includes/header.htm"
end if
%>
This is cs1.htm<BR>
<a href="cs1.htm">cs1</a><BR><BR>
<a href="1.htm">frame page 1.htm</a><BR><BR>
<a href="cs2.htm">cs2</a><BR><BR>
<a href="cs1.htm" target="_top">out of frame</a><BR><BR>
</BODY></html>
Message #2 by "O'Hara, Elliott M" <EMOHARA@k...> on Mon, 11 Mar 2002 13:15:44 -0500
|
|
had the same problem...
make sure your caching ISAPI apps....
Theres a MS arcticle out there somewhere about this.
-----Original Message-----
From: Pham, Khanh [mailto:Khanh.Pham@d...]
Sent: Monday, March 11, 2002 12:53 PM
To: ASP Web HowTo
Subject: [asp_web_howto] server.execute inside a frame
I hope someone can help with this problem.
My division is putting together an intranet department wide. I have a
header with a our logo and a global navigation on every page. Another
division wants their pages inside a frame with their our header on the top
frame. What I want to do is when a page is inside a frame to just leave it
alone. When a page is not in a frame for my header to be added. I was able
to get the most part of it to work. The only problem is you have to refresh
the page to get the header to work outside a frame or refresh within a frame
to remove the header. I use Javascript to determine if the page is in a
frame and set a cookie value. Then use asp to check that cookie and perform
a server.execute to add the header if necessary. Below is my test page.
Any advice will be helpful.
<html>
<head>
<TITLE>Services</TITLE>
<LINK href="/intranet/includes/intranet.css" type=text/css rel=stylesheet>
<script language="JavaScript">
if (top.location == location) {
document.cookie = "inFrames=no";
}
else{
document.cookie = "inFrames=yes";
}
//window.location.replace = "cs1.htm"
</script>
</head>
<BODY topmargin="0" leftmargin="5">
<%
'-------------------------------------------------
if Request.Cookies("inFrames") = "no" then
server.Execute "/intranet/includes/header.htm"
end if
%>
This is cs1.htm<BR>
<a href="cs1.htm">cs1</a><BR><BR>
<a href="1.htm">frame page 1.htm</a><BR><BR>
<a href="cs2.htm">cs2</a><BR><BR>
<a href="cs1.htm" target="_top">out of frame</a><BR><BR>
</BODY></html>
$subst('Email.Unsub').
Message #3 by "Ken Schaefer" <ken@a...> on Tue, 12 Mar 2002 12:52:03 +1100
|
|
The ASP executes first (before the cookie has been set).
Then the client-side javascript is run (in the browser), which sets the
cookie
Then you refresh the page, and the ASP runs again, triggering your function.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Pham, Khanh" <Khanh.Pham@d...>
Subject: [asp_web_howto] server.execute inside a frame
: I hope someone can help with this problem.
:
: My division is putting together an intranet department wide. I have a
: header with a our logo and a global navigation on every page. Another
: division wants their pages inside a frame with their our header on the top
: frame. What I want to do is when a page is inside a frame to just leave
it
: alone. When a page is not in a frame for my header to be added. I was
able
: to get the most part of it to work. The only problem is you have to
refresh
: the page to get the header to work outside a frame or refresh within a
frame
: to remove the header. I use Javascript to determine if the page is in a
: frame and set a cookie value. Then use asp to check that cookie and
perform
: a server.execute to add the header if necessary. Below is my test page.
: Any advice will be helpful.
:
: <html>
: <head>
: <TITLE>Services</TITLE>
: <LINK href="/intranet/includes/intranet.css" type=text/css rel=stylesheet>
: <script language="JavaScript">
: if (top.location == location) {
: document.cookie = "inFrames=no";
: }
: else{
: document.cookie = "inFrames=yes";
: }
: //window.location.replace = "cs1.htm"
: </script>
:
: </head>
: <BODY topmargin="0" leftmargin="5">
: <%
:
: '-------------------------------------------------
: if Request.Cookies("inFrames") = "no" then
: server.Execute "/intranet/includes/header.htm"
: end if
: %>
: This is cs1.htm<BR>
: <a href="cs1.htm">cs1</a><BR><BR>
: <a href="1.htm">frame page 1.htm</a><BR><BR>
: <a href="cs2.htm">cs2</a><BR><BR>
: <a href="cs1.htm" target="_top">out of frame</a><BR><BR>
: </BODY></html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #4 by "Pham, Khanh" <Khanh.Pham@d...> on Tue, 12 Mar 2002 06:58:23 -0500
|
|
thanks Ken, that explains it.
-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: Monday, March 11, 2002 8:52 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: server.execute inside a frame
The ASP executes first (before the cookie has been set).
Then the client-side javascript is run (in the browser), which sets the
cookie
Then you refresh the page, and the ASP runs again, triggering your function.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Pham, Khanh" <Khanh.Pham@d...>
Subject: [asp_web_howto] server.execute inside a frame
: I hope someone can help with this problem.
:
: My division is putting together an intranet department wide. I have a
: header with a our logo and a global navigation on every page. Another
: division wants their pages inside a frame with their our header on the top
: frame. What I want to do is when a page is inside a frame to just leave
it
: alone. When a page is not in a frame for my header to be added. I was
able
: to get the most part of it to work. The only problem is you have to
refresh
: the page to get the header to work outside a frame or refresh within a
frame
: to remove the header. I use Javascript to determine if the page is in a
: frame and set a cookie value. Then use asp to check that cookie and
perform
: a server.execute to add the header if necessary. Below is my test page.
: Any advice will be helpful.
:
: <html>
: <head>
: <TITLE>Services</TITLE>
: <LINK href="/intranet/includes/intranet.css" type=text/css rel=stylesheet>
: <script language="JavaScript">
: if (top.location == location) {
: document.cookie = "inFrames=no";
: }
: else{
: document.cookie = "inFrames=yes";
: }
: //window.location.replace = "cs1.htm"
: </script>
:
: </head>
: <BODY topmargin="0" leftmargin="5">
: <%
:
: '-------------------------------------------------
: if Request.Cookies("inFrames") = "no" then
: server.Execute "/intranet/includes/header.htm"
: end if
: %>
: This is cs1.htm<BR>
: <a href="cs1.htm">cs1</a><BR><BR>
: <a href="1.htm">frame page 1.htm</a><BR><BR>
: <a href="cs2.htm">cs2</a><BR><BR>
: <a href="cs1.htm" target="_top">out of frame</a><BR><BR>
: </BODY></html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$subst('Email.Unsub').
Message #5 by "O'Hara, Elliott M" <EMOHARA@k...> on Tue, 12 Mar 2002 07:09:08 -0500
|
|
Thanks Ken, for telling me to read the entire question before posting an
answer :o)
-----Original Message-----
From: Pham, Khanh [mailto:Khanh.Pham@d...]
Sent: Tuesday, March 12, 2002 6:58 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: server.execute inside a frame
thanks Ken, that explains it.
-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: Monday, March 11, 2002 8:52 PM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: server.execute inside a frame
The ASP executes first (before the cookie has been set).
Then the client-side javascript is run (in the browser), which sets the
cookie
Then you refresh the page, and the ASP runs again, triggering your function.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Pham, Khanh" <Khanh.Pham@d...>
Subject: [asp_web_howto] server.execute inside a frame
: I hope someone can help with this problem.
:
: My division is putting together an intranet department wide. I have a
: header with a our logo and a global navigation on every page. Another
: division wants their pages inside a frame with their our header on the top
: frame. What I want to do is when a page is inside a frame to just leave
it
: alone. When a page is not in a frame for my header to be added. I was
able
: to get the most part of it to work. The only problem is you have to
refresh
: the page to get the header to work outside a frame or refresh within a
frame
: to remove the header. I use Javascript to determine if the page is in a
: frame and set a cookie value. Then use asp to check that cookie and
perform
: a server.execute to add the header if necessary. Below is my test page.
: Any advice will be helpful.
:
: <html>
: <head>
: <TITLE>Services</TITLE>
: <LINK href="/intranet/includes/intranet.css" type=text/css rel=stylesheet>
: <script language="JavaScript">
: if (top.location == location) {
: document.cookie = "inFrames=no";
: }
: else{
: document.cookie = "inFrames=yes";
: }
: //window.location.replace = "cs1.htm"
: </script>
:
: </head>
: <BODY topmargin="0" leftmargin="5">
: <%
:
: '-------------------------------------------------
: if Request.Cookies("inFrames") = "no" then
: server.Execute "/intranet/includes/header.htm"
: end if
: %>
: This is cs1.htm<BR>
: <a href="cs1.htm">cs1</a><BR><BR>
: <a href="1.htm">frame page 1.htm</a><BR><BR>
: <a href="cs2.htm">cs2</a><BR><BR>
: <a href="cs1.htm" target="_top">out of frame</a><BR><BR>
: </BODY></html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$subst('Email.Unsub').
$subst('Email.Unsub').
|
|
 |