[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

How to call script in different frame

Asked by wilg0005 in .NET, Dynamic HTML (DHTML)

Tags: different, img2m, javascript

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.vb" %>
<!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_defaultClientScript">
            <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_defaultClientScript">
            <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/headerBackground.gif bgColor=AliceBlue>
                        <img src=images/header/smurfitLogo.gif></td>
                  <td width=150 align=center valign=top background=images/header/headerBackground.gif bgColor=AliceBlue><br>
                  <td valign=top background=images/header/bg_banner.gif></td>
                  <td valign=bottom align=right background=images/header/headerBackground.gif bgColor=AliceBlue>
                        <img  height=76 src=images/header/globeLogo.gif></td>
            </tr>
            </table>
            
<!--Tabs Section-->      
            <table width=100% border=0 cellspacing=0 cellpadding=0>
            <tr>
                  <td width=53% align=left background=images/header/bg.gif bgColor=AliceBlue>
                        
                        <table width=405 border=0 cellpadding=0 cellspacing=0>
                  <tr>
                        <td width=6 height=18 background=images/header/spacer.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/tabLeftSelected.gif></td>
<td width=82 height=18 id=img0M onMouseOver=vbScript:tabOn0() onMouseOut=vbScript:tabOff0()
      onClick=vbScript:changeActLabel0() style=CURSOR:hand background=images/header/tabMiddleSelected.gif>
      <font id=tab0 color=navy><b>Home</b></font></td>
<td width=8 height=18 id=img0R background=images/header/tabRightSelected.gif></td>
<td width=8 height=18 id=img1L background=images/header/tabLeftUnselected.gif></td>
<td width=125 height=18 id=img1M onMouseOver=vbScript:tabOn1() onMouseOut=vbScript:tabOff1()
      onClick=vbScript:changeActLabel1() style=CURSOR:hand background=images/header/tabMiddleUnselected.gif>
      <font id=tab1 color=navy><b>User Profile</b></font></td>
<td width=8 height=18 id=img1R background=images/header/tabRightUnselected.gif></td>
<td width=8 height=18 id=img2L background=images/header/tabLeftUnselected.gif></td>
<td width=150 height=18 id=img2M onMouseOver=vbScript:tabOn2() onMouseOut=vbScript:tabOff2()
      onClick=vbScript:changeActLabel2() style=CURSOR:hand background=images/header/tabMiddleUnselected.gif>
      <font id=tab2 color=navy><b>Administration</b></font></td>
<td width=8 height=18 id=img2R background=images/header/tabRightUnselected.gif></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></div>
                  </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.gif" 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.gif" 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.gif" 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="images/header/tabLeftSelected.gif"
      window.img0M.background="images/header/tabMiddleSelected.gif"
      window.img0R.background="images/header/tabRightSelected.gif"
      tab0.color = Navy
      parent.frames("main").location.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="images/header/tabLeftSelected.gif"
      window.img1M.background="images/header/tabMiddleSelected.gif"
      window.img1R.background="images/header/tabRightSelected.gif"
      tab1.color = Navy
      parent.frames("main").location.href="userprofile/userProfile.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="images/header/tabLeftSelected.gif"
      window.img2M.background="images/header/tabMiddleSelected.gif"
      window.img2R.background="images/header/tabRightSelected.gif"
      tab2.color = Navy
      parent.frames("main").location.href="administration/administration.aspx"
end sub

<!--Clear Tabs-->
sub ClearTabs()
      window.img0L.background="images/header/tabLeftUnselected.gif"
      window.img0M.background="images/header/tabMiddleUnselected.gif"
      window.img0R.background="images/header/tabRightUnselected.gif"
      window.img1L.background="images/header/tabLeftUnselected.gif"
      window.img1M.background="images/header/tabMiddleUnselected.gif"
      window.img1R.background="images/header/tabRightUnselected.gif"
      window.img2L.background="images/header/tabLeftUnselected.gif"
      window.img2M.background="images/header/tabMiddleUnselected.gif"
      window.img2R.background="images/header/tabRightUnselected.gif"
end sub

</script>

      </body>
</html>

[+][-]12/11/05 07:27 PM, ID: 15464181Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: .NET, Dynamic HTML (DHTML)
Tags: different, img2m, javascript
Sign Up Now!
Solution Provided By: amit_g
Participating Experts: 1
Solution Grade: A
 
[+][-]12/12/05 06:30 AM, ID: 15466383Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12/12/05 12:57 PM, ID: 15469475Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92