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:
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 Object, ByVal 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 Object, ByVal 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 Object, ByVal 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 |