I get this message.
"BC30451: Name 'top' is not declared."
Main Topics
Browse All TopicsI have script in the first frame of my page that I want to call from the second frame. The sub I want to call is ClearTabs().
I tried Parent.header.ClearTabs(),
Here is some code.
*******Default page************
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.v
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Web Application Exercise</TITLE>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScri
<meta content="http://schemas.mi
<LINK href="inventory.css" type="text/css" rel="stylesheet">
</HEAD>
<frameset frameSpacing="0" rows="123,83%" frameBorder="no">
<frame name="header" marginWidth="0" marginHeight="0" src="header.aspx" scrolling="no">
<frame name="main" marginWidth="0" marginHeight="0" src="home/home.aspx">
<noframes>
<p>
This HTML frameset displays multiple Web pages. To view this frameset, use a
Web browser that supports HTML 4.0 and later.
</p>
</noframes>
</frameset>
</HTML>
************Header Page****************
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Web Application Exercise</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScri
<meta content="http://schemas.mi
<link href="inventory.css" type="text/css" rel="stylesheet">
</head>
<body>
<!--Header Section-->
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr>
<td width=350 align=center valign=bottom background=images/header/h
<img src=images/header/smurfitL
<td width=150 align=center valign=top background=images/header/h
<td valign=top background=images/header/b
<td valign=bottom align=right background=images/header/h
<img height=76 src=images/header/globeLog
</tr>
</table>
<!--Tabs Section-->
<table width=100% border=0 cellspacing=0 cellpadding=0>
<tr>
<td width=53% align=left background=images/header/b
<table width=405 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=6 height=18 background=images/header/s
<!--Generated Code: Creates a dynamic number of tabs based on the variables tabText, tabStatus and tabSize-->
<td width=8 height=18 id=img0L background=images/header/t
<td width=82 height=18 id=img0M onMouseOver=vbScript:tabOn
onClick=vbScript:changeAct
<font id=tab0 color=navy><b>Home</b></fo
<td width=8 height=18 id=img0R background=images/header/t
<td width=8 height=18 id=img1L background=images/header/t
<td width=125 height=18 id=img1M onMouseOver=vbScript:tabOn
onClick=vbScript:changeAct
<font id=tab1 color=navy><b>User Profile</b></font></td>
<td width=8 height=18 id=img1R background=images/header/t
<td width=8 height=18 id=img2L background=images/header/t
<td width=150 height=18 id=img2M onMouseOver=vbScript:tabOn
onClick=vbScript:changeAct
<font id=tab2 color=navy><b>Administrati
<td width=8 height=18 id=img2R background=images/header/t
</tr>
</table>
</td>
</tr>
</table>
<!--Transition to Main Page Section-->
<table WIDTH="100%" BORDER="0" CELLPADDING="5" CELLSPACING="0">
<tr>
<td nowrap bgcolor="#6db5ff" valign=bottom align="left" class="white"><div id="now"><strong><font color="navy">
<b>12/8/2005 4:26:26 PM</b></font></strong></di
</td>
<td nowrap bgcolor="#6db5ff" valign=bottom align="right" class="white"><div id="topic"><strong><font size=2 color="navy">
<b>Logged in as Gerald</b></font></strong>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" bgcolor=DarkGray><img src="images/header/trans.g
</tr>
</table>
<table WIDTH="100%" BORDER="0" CELLPADDING="1" CELLSPACING="0">
<tr>
<td bgcolor=LightGray><img src="images/header/trans.g
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" bgcolor=GhostWhite><img src="images/header/trans.g
</tr>
</table>
<!--Script to change tabs: The script is dynamically created by looping through the number of tabs using the array tabText.
It also uses the array tabURL to change the main page.-->
<Script Language=VBScript>
<!--Tab 1-->
sub tabOn0()
tab0.color = Red
end sub
sub tabOff0()
tab0.color = Navy
end sub
sub changeActLabel0()
ClearTabs()
window.img0L.background="i
window.img0M.background="i
window.img0R.background="i
tab0.color = Navy
parent.frames("main").loca
end sub
<!--Tab 2-->
sub tabOn1()
tab1.color = Red
end sub
sub tabOff1()
tab1.color = Navy
end sub
sub changeActLabel1()
ClearTabs()
window.img1L.background="i
window.img1M.background="i
window.img1R.background="i
tab1.color = Navy
parent.frames("main").loca
end sub
<!--Tab 3-->
sub tabOn2()
tab2.color = Red
end sub
sub tabOff2()
tab2.color = Navy
end sub
sub changeActLabel2()
ClearTabs()
window.img2L.background="i
window.img2M.background="i
window.img2R.background="i
tab2.color = Navy
parent.frames("main").loca
end sub
<!--Clear Tabs-->
sub ClearTabs()
window.img0L.background="i
window.img0M.background="i
window.img0R.background="i
window.img1L.background="i
window.img1M.background="i
window.img1R.background="i
window.img2L.background="i
window.img2M.background="i
window.img2R.background="i
end sub
</script>
</body>
</html>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: amit_gPosted on 2005-12-11 at 19:27:32ID: 15464181
Call it as ...
Tabs()
top.frames["header"].Clear