This is a migrated thread and some comments may be shown as answers.

Accessing javascript function in parent page

1 Answer 94 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
iomega 55
Top achievements
Rank 1
iomega 55 asked on 03 Aug 2012, 06:05 PM
I have a base page with the next code in the .aspx
<telerik:RadSplitter runat="Server" ID="splMain" Width="100%" BorderSize="0"
    BorderStyle="None" PanesBorderSize="0" Height="100%" Orientation="Horizontal"
    VisibleDuringInit="false">
    <telerik:RadPane ID="topPane" runat="server" Height="60px" BackColor="#157164">
        <telerik:RadAjaxPanel ID="radAjaxPanel01" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadMenu id="mnuTop01" runat="server" EnableViewState="false" CausesValidation="false" OnClientItemClicked="OnClientItemClicked" CollapseAnimation-Type="None" 
        EnableShadows="true" EnableRoundedCorners="true" Style="float: none; position:absolute; top:20px; z-index:2000;" Width="100%"  >       
            </telerik:RadMenu>
            <div class="div02" style="float: none; position:absolute; top:45px; height:16px; text-align:center;">
                <asp:Label ID="lblApp" runat="server" cssclass="tb2" Text="Inicio"/>
            </div>
        </telerik:RadAjaxPanel>
    </telerik:RadPane>
    <telerik:RadPane runat="server" ID="pnlContenido" Scrolling="Both" ContentUrl="ePageEmpty00.aspx?a=some" ShowContentDuringLoad="false">
    </telerik:RadPane>
</telerik:RadSplitter>

vía a javascript function I change the Label (LblApp) text.

function fnT(a) {
    var l = document.getElementById("lblApp");
    l.innerHTML = a;
}


Here is myquestion, I´m loading in the pnlContenido RadPane an external .aspx, how can I change the LblApp text, from the external.aspx:
I have tried this in the external.aspx, but it doesnt work:

window.onload = function () {
    window.parent.fnT('Some Info');
}


Can somebody help me, please.

Thanks in advance.


1 Answer, 1 is accepted

Sort by
0
iomega 55
Top achievements
Rank 1
answered on 05 Aug 2012, 04:30 AM
I solved with this code in the external.aspx . Very important dont place windows. at the beginning of the call to the javascript function

<script type="text/javascript" language="javascript">
    window.onload = function () {
        parent.fnT('New text');
    }    
</script>

Tags
Splitter
Asked by
iomega 55
Top achievements
Rank 1
Answers by
iomega 55
Top achievements
Rank 1
Share this question
or