I 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(),
but that did not work. How can I call ClearTabs from the "main" page.
Here is some code.
*******Default page************
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.v
b" %>
<!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
pt">
<meta content="
http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<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
pt">
<meta content="
http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<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
eaderBackg
round.gif bgColor=AliceBlue>
<img src=images/header/smurfitL
ogo.gif></
td>
<td width=150 align=center valign=top background=images/header/h
eaderBackg
round.gif bgColor=AliceBlue><br>
<td valign=top background=images/header/b
g_banner.g
if></td>
<td valign=bottom align=right background=images/header/h
eaderBackg
round.gif bgColor=AliceBlue>
<img height=76 src=images/header/globeLog
o.gif></td
>
</tr>
</table>
<!--Tabs Section-->
<table width=100% border=0 cellspacing=0 cellpadding=0>
<tr>
<td width=53% align=left background=images/header/b
g.gif bgColor=AliceBlue>
<table width=405 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=6 height=18 background=images/header/s
pacer.gif>
</td>
<!--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
abLeftSele
cted.gif><
/td>
<td width=82 height=18 id=img0M onMouseOver=vbScript:tabOn
0() onMouseOut=vbScript:tabOff
0()
onClick=vbScript:changeAct
Label0() style=CURSOR:hand background=images/header/t
abMiddleSe
lected.gif
>
<font id=tab0 color=navy><b>Home</b></fo
nt></td>
<td width=8 height=18 id=img0R background=images/header/t
abRightSel
ected.gif>
</td>
<td width=8 height=18 id=img1L background=images/header/t
abLeftUnse
lected.gif
></td>
<td width=125 height=18 id=img1M onMouseOver=vbScript:tabOn
1() onMouseOut=vbScript:tabOff
1()
onClick=vbScript:changeAct
Label1() style=CURSOR:hand background=images/header/t
abMiddleUn
selected.g
if>
<font id=tab1 color=navy><b>User Profile</b></font></td>
<td width=8 height=18 id=img1R background=images/header/t
abRightUns
elected.gi
f></td>
<td width=8 height=18 id=img2L background=images/header/t
abLeftUnse
lected.gif
></td>
<td width=150 height=18 id=img2M onMouseOver=vbScript:tabOn
2() onMouseOut=vbScript:tabOff
2()
onClick=vbScript:changeAct
Label2() style=CURSOR:hand background=images/header/t
abMiddleUn
selected.g
if>
<font id=tab2 color=navy><b>Administrati
on</b></fo
nt></td>
<td width=8 height=18 id=img2R background=images/header/t
abRightUns
elected.gi
f></td>
</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
v>
</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>
</div>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" bgcolor=DarkGray><img src="images/header/trans.g
if" width="1" height="1"></td>
</tr>
</table>
<table WIDTH="100%" BORDER="0" CELLPADDING="1" CELLSPACING="0">
<tr>
<td bgcolor=LightGray><img src="images/header/trans.g
if" width="4" height="1"></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" bgcolor=GhostWhite><img src="images/header/trans.g
if" width="1" height="1"></td>
</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
mages/head
er/tabLeft
Selected.g
if"
window.img0M.background="i
mages/head
er/tabMidd
leSelected
.gif"
window.img0R.background="i
mages/head
er/tabRigh
tSelected.
gif"
tab0.color = Navy
parent.frames("main").loca
tion.href=
"home/home
.aspx"
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
mages/head
er/tabLeft
Selected.g
if"
window.img1M.background="i
mages/head
er/tabMidd
leSelected
.gif"
window.img1R.background="i
mages/head
er/tabRigh
tSelected.
gif"
tab1.color = Navy
parent.frames("main").loca
tion.href=
"userprofi
le/userPro
file.aspx"
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
mages/head
er/tabLeft
Selected.g
if"
window.img2M.background="i
mages/head
er/tabMidd
leSelected
.gif"
window.img2R.background="i
mages/head
er/tabRigh
tSelected.
gif"
tab2.color = Navy
parent.frames("main").loca
tion.href=
"administr
ation/admi
nistration
.aspx"
end sub
<!--Clear Tabs-->
sub ClearTabs()
window.img0L.background="i
mages/head
er/tabLeft
Unselected
.gif"
window.img0M.background="i
mages/head
er/tabMidd
leUnselect
ed.gif"
window.img0R.background="i
mages/head
er/tabRigh
tUnselecte
d.gif"
window.img1L.background="i
mages/head
er/tabLeft
Unselected
.gif"
window.img1M.background="i
mages/head
er/tabMidd
leUnselect
ed.gif"
window.img1R.background="i
mages/head
er/tabRigh
tUnselecte
d.gif"
window.img2L.background="i
mages/head
er/tabLeft
Unselected
.gif"
window.img2M.background="i
mages/head
er/tabMidd
leUnselect
ed.gif"
window.img2R.background="i
mages/head
er/tabRigh
tUnselecte
d.gif"
end sub
</script>
</body>
</html>