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

SelectedTab with TabBar, RadMultiPage and RadAjaxManager

3 Answers 114 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 09 Oct 2012, 09:13 PM
I have a simple page with a TabBar and RadMultiPage.  I hooked up the ajaxified the TabBar and MultiPage with the AjaxManager but the selected tab (visually) isn't persisting after clicking on a tab.  Code is below.  Anything I am missing?  It works as expected when removing the AjaxManager and having a regular postback.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" />
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
        AutoPostBack="true">
        <Tabs>
            <telerik:RadTab Text="Tab 1">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab 2">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="HealthSafetyPage" runat="server">
            <p>
                Tab 1 content
            </p>
        </telerik:RadPageView>
        <telerik:RadPageView ID="ProcessSafetyPage" runat="server">
            <p>
                Tab 2 content
            </p>
        </telerik:RadPageView>
    </telerik:RadMultiPage>

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 10 Oct 2012, 03:55 AM
Hi Ryan,

Please modify your code as follows.

ASPX:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
  <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
        <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
      </UpdatedControls>
    </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default" />
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" AutoPostBack="true">
  <Tabs>
     <telerik:RadTab Text="Tab 1">
     </telerik:RadTab>
     <telerik:RadTab Text="Tab 2">
     </telerik:RadTab>
  </Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
  <telerik:RadPageView ID="HealthSafetyPage" runat="server">
     <p>
       Tab 1 content
     </p>
  </telerik:RadPageView>
  <telerik:RadPageView ID="ProcessSafetyPage" runat="server">
     <p>
       Tab 2 content
     </p>
  </telerik:RadPageView>
</telerik:RadMultiPage>

Hope this helps.

Regards,
Princy.
0
Ryan
Top achievements
Rank 1
answered on 10 Oct 2012, 05:16 PM
Hi Princy,

Thanks for the quick response.  Your example does work, but is there anyway to do it without having the TabStrip reload (showing the loading panel and being inactive)?

Thanks,
Ryan
0
Nencho
Telerik team
answered on 15 Oct 2012, 12:55 PM
Hello Ryan,

This behavior is caused by the fact that the AutoPostBack property is set to "True". In order to prevent the postback, this property should be set to "False".

Regards,
Nencho
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TabStrip
Asked by
Ryan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ryan
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or