Load On Demand Problems

2 posts, 0 answers
  1. 34gl3
    34gl3 avatar
    19 posts
    Member since:
    Oct 2006

    Posted 14 Jul 2008 Link to this post

    Hi,
    I am using the LoadOnDemand example, but i have this problem: the tabclick event fires just the first time.
    When i click on the second tab it works, but after this when i click on the first tab, the event won't fires.
    Here is my code:

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
        <script type="text/javascript">  
            function onTabSelecting(sender, args)  
            {  
                 if (args.get_tab().get_pageView())    
                 {    
                       args.get_tab().set_postBack(false);    
                 }  
            }  
              
        </script> 
    </telerik:RadCodeBlock> 
     
                <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" OnClientTabSelecting="onTabSelecting" OnTabClick="RadTabStrip1_TabClick" /> 
                <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated" /> 
     
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1">  
                <asp:Image runat="server" ID="LoadingImage1" ImageUrl="~/Ajax/Img/loading7.gif" AlternateText="Loading..." /> 
            </telerik:RadAjaxLoadingPanel> 
            <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="RadTabStrip1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> 
                            <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                    <telerik:AjaxSetting AjaxControlID="RadMultiPage1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
     

     
     
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
                    RadTabStrip1.Tabs.Add(New RadTab("FirstTab""FirstValue"))  
                    RadTabStrip1.Tabs.Add(New RadTab("SecondTab""SecondValue"))  
                    If Not Page.IsPostBack Then 
                        AddPageView(RadTabStrip1.FindTabByValue("FirstValue"))  
                    End If 
    End Sub 
     
            Protected Sub RadTabStrip1_TabClick(ByVal sender As ObjectByVal e As RadTabStripEventArgs)  
                If String.IsNullOrEmpty(e.Tab.PageViewID) Then 
                    AddPageView(e.Tab)  
                End If 
                e.Tab.PageView.Selected = True 
            End Sub 
     
            Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As ObjectByVal e As RadMultiPageEventArgs)  
                Dim strControl As String = "Controls/" & e.PageView.ID & ".ascx" 
                Dim Control As UserControl = Page.LoadControl(strControl)  
                Control.ID = e.PageView.ID + "_Control" 
                e.PageView.Controls.Add(Control)  
            End Sub 
     
            Private Sub AddPageView(ByVal Tab As RadTab)  
                Dim PageView As New RadPageView()  
                PageView.ID = Tab.Value  
                RadMultiPage1.PageViews.Add(PageView)  
                Tab.PageViewID = PageView.ID  
            End Sub 
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 14 Jul 2008 Link to this post

    Hello LCB,

    The behavior you are experiencing is by design. Clicking a tab causes postback only the first time (this is done in the tabSelecting client-side event).

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top