Click to See Complete Forum and Search --> : IFrame Name


Justin
06-01-2004, 04:51 PM
Is there a way for asp to check what's the name of the frame it is in?

If not, how do you send a var through a link, like form.asp then src="main"

I think it's something like form.asp?name="main" ????????????

simflex
06-03-2004, 03:38 PM
I would use a case statement to accomplish what you are trying to accomplish.

Something like this:

dim FrameName
FrameName = Request.QueryString( "FN" )

Response.Write( "<html><head><title></title></head>" )
SELECT CASE LCASE( FrameName )
CASE "header"
Response.Write( "<body bgcolor=""lightgreen"">This is the HEADER FRAME</body>" )
CASE "left"
Response.Write( "<body bgcolor=""lightblue"">This is the LEFT FRAME</body>" )
CASE "body"
Response.Write( "<body bgcolor=""lightyellow"">This is the BODY FRAME</body>" )
CASE ELSE
WITH Response
.Write( "<frameset rows=""64,*"">" )
.Write( "<frame name=""HEADER"" scrolling=""no"" " )
.Write( "noresize target=""contents"" marginwidth=""0"" " )
.Write( "marginheight=""0"" src=""asp_10.asp?FN=header"">" )
.Write( " <frameset cols=""150,*""><frame " )
.Write( "name=""LEFT"" target=""main"" marginwidth=" )
.Write( """0"" marginheight=""0"" scrolling=""auto"" " )
>.Write( "noresize src=""asp_10.asp?FN=left"">" )
.Write( "<frame name=""BODY"" marginwidth=""0"" " )
.Write( "marginheight=""0"" scrolling=""auto"" " )
.Write( "src=""asp_10.asp?FN=body""></frameset>" )
.Write( "<noframes><body><p>This page " )
.Write( "uses frames, but your browser doesn't support them." )
.Write( "</p></body></noframes>" )
.Write( "</frameset></html>" )
END WITH
END SELECT

%>

Hope this helps