RadMultipage with UserControl Javascript not loading

5 posts, 0 answers
  1. Sagar
    Sagar avatar
    1 posts
    Member since:
    Jul 2010

    Posted 11 Oct 2010 Link to this post

    I have a TabStrip of 6 tabs and for each tab i have one user control defined.
    in each user control i am rendering radgrid. In each user control i have some javascripts written in it.
    In these javascript i am finding object of radgrid mastertableview and using it for filter templates .
    I have set property RenderSelectedPage only to true
    My problem is, javascript is rendered for the first time page load (first page view i.e. my default pageview)only.
    but for subsequent tab selection respective java-scripts are not rendered because of which it does not get subsequent radgrid objects
    here i am using server tags like <% ...%> to find radgrid mastertableview objects in java scripts.

    Please suggest a solution
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 13 Oct 2010 Link to this post

    Hi Sagar,

    You should place the javascript code inside RadScriptBlock. Please try it and let us know the result.

    All the best,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Aaron
    Aaron avatar
    9 posts
    Member since:
    Jun 2009

    Posted 10 Nov 2010 Link to this post

    I'm having the almost exact same scenario, i also have six tabs, a multipageview, and a usercontrol for each tab, i already created my validation function, but, from what i see, the user control is not loading the js files, tried in differents ways, but still i got no success, today i lost the entire day trying to make it work, i attached some sample code.

    First i did it this way.

    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
     
        <script src="../Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
     
        <script src="../Scripts/TRW.DNN.Catalogs.Modules.js" type="text/javascript"></script>
     
    </telerik:RadScriptBlock>

    after that i tried the registerstartupscript

    string ScriptjQuery = "<script language='javascript' src='../Scripts/jquery-1.4.2.min.js'></script>";
    string ScriptModules = "<script language='javascript' src='../Scripts/TRW.DNN.Catalogs.Modules.js'></script>";
     
    if (!this.Page.IsStartupScriptRegistered("jQuery"))
    {
        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "jQuery", ScriptjQuery, false);
    }
    if (!this.Page.IsStartupScriptRegistered("Module"))
    {
        ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Module", ScriptModules, false);
    }

    and i still got no luck, and i even tried simple javascript validation, without using the jQuery library, but is the same end.

  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 16 Nov 2010 Link to this post

    Hello Aaron,

    I tried to reproduce this issue but to no avail. The javascript code is included at our side. Also you don't need to include manually jquery as it's a part of Telerik.Web.UI as explained here.

    Regards,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Eric
    Eric avatar
    1 posts
    Member since:
    Jul 2012

    Posted 29 Jul 2014 in reply to Yana Link to this post

    Hi Yana,
    I'm looking for a solution to the same problem.

    My function call is placed within a RadscriptBlock that is calling a function from an external js file.

    Any ideas for a solution?


            <telerik:RadTabStrip ID="PortalTabStrip" runat="server" OnTabClick="PortalTabStripTabClick"
                AutoPostBack="True" BorderStyle="None" SelectedIndex="0" MultiPageID="RadMultiPage1" OnClientTabSelected="OnClientTabSelected">
                <Tabs>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage1" RenderSelectedPageOnly="True" runat="server" SelectedIndex="0" OnLoad="RadMultiPageLoad" OnPageViewCreated="RadMultiPage1PageViewCreated">
            </telerik:RadMultiPage>



        <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">

            <script type="text/javascript">
                Type.registerNamespace('VV');
                Type.registerNamespace('VV.Portal');

                VV.Portal.PortalTabStrip = '<%= PortalTabStrip.ClientID %>';

                
                $(document).ready(function () {
                    PortalTabPageViewIframeResize();
                });

                function OnClientTabSelected(sender, eventArgs) {
                    var tab = eventArgs.get_tab();
                    PortalTabPageViewIframeResize();
                }
                
                $(window).resize(function () {
                    debugger
                    PortalTabPageViewIframeResize();
                });
                

            </script>

        </telerik:RadScriptBlock>




Back to Top
UI for ASP.NET Ajax is Ready for VS 2017