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

RadMultipage with UserControl Javascript not loading

4 Answers 88 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Sagar
Top achievements
Rank 1
Sagar asked on 11 Oct 2010, 12:25 PM
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

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 13 Oct 2010, 09:22 AM
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
0
Aaron
Top achievements
Rank 2
answered on 10 Nov 2010, 11:31 PM
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.

0
Yana
Telerik team
answered on 16 Nov 2010, 11:22 AM
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
0
Eric
Top achievements
Rank 1
answered on 29 Jul 2014, 09:23 PM
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>




Tags
TabStrip
Asked by
Sagar
Top achievements
Rank 1
Answers by
Yana
Telerik team
Aaron
Top achievements
Rank 2
Eric
Top achievements
Rank 1
Share this question
or