Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Web Tab - Call javascript inside a tab linked page

Hi everyone,

I have a problem for upgrade a (very complex) application from the old infragistics library (version 10) to the new ones.

I have an environment with 2 iframes (Menu and Funz)

In iframe (Menu) I have a WebTab (TabMenu) with 3 tabs, in the other iframe (Funz) I have a webdatagrid and a button.

The WebTab loads three aspx pages: menu1.aspx / menu2.aspx 3 menu3.aspx.

Clicking on the button, in addition to the postback of the iframe (funz) I reached the page (menu2.aspx) inside Tab (2) and updated it by calling a javascript contained inside a page (menu2.aspx).

With infragistics version 10, in the button OnClick event (server side)  I updated some session variable and recorded a javascript:

<script language = "javascript" type = "text / javascript">

   function RefreshMenu2 () {

      var Menu2;    // content of menu2.aspx

     Menu2 = top.Menu.document.getElementById ("TabMenu_frame1");

     Menu2.contentWindow.RefreshCUS ();



The script ran the javascript RefreshCUS ()  (on menu2.aspx) which performed a _doPostback () and re-read the new session data by reconstructing a list. This function, in practice, was used to move selected records on a webdatagrid in an iframe to another webdatagrid on the other iframe. 

Now, with Infragistics 20.x I can no longer get the menu2.aspx page for call the javascript that it contains due to the new structure of WebTab.

Anyone have a suggestion?

Thank you

  • 29417
    Verified Answer
    Offline posted

    Hello Andrea,

    Thank you for posting in our forum.

    You could get and store the WebTab client object on the related window when the Tab loads, for example:

    Tab definition:
    <ig:WebTab ID="TabMenu" runat="server” …>
    <ClientEvents Loaded="TabMenu_Loaded" />

    Client script:

    <script type="text/javascript" id="igClientScript">

    function TabMenu_Loaded(sender, eventArgs)
    window.WebTab = sender;


    And use its API to get the children frames, for example:

    function Button_Click() {
    var MenuFrameWindow = top.Menu.contentWindow;
    var WebTab = MenuFrameWindow.WebTab;
    var frame = WebTab.getTabAt(0).get_iframe();

    Using the public API will ensure you can get the correct iframes even if their inner implementation (like their assigned ids) change between versions.

    Let me know if that would solve your issue.

    Maya Kirova