To recreate
1) Make telerik ajax project in vs2010
2) Add a master page and add radajaxmanager,radscriptmanager and radajaxloadingpanel
3) Add content page with the following
<
asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Panel1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="TabStrip">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="TabStrip" />
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1"
LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadMultiPage1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Sunset">
</telerik:RadSkinManager>
<telerik:RadTabStrip ID="TabStrip" runat="server" ViewStateMode="Enabled" OnClientTabSelecting="onTabSelecting"
ClientIDMode="Static" MultiPageID="RadMultiPage1" OnTabClick="RadTabStrip1_TabClick"
SelectedIndex="0">
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="multiPage"
ClientIDMode="Static" ViewStateMode="Enabled" OnPageViewCreated="RadMultiPage1_PageViewCreated">
</telerik:RadMultiPage>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function onTabSelecting(sender, args) {
if (args.get_tab().get_pageViewID()) {
args.get_tab().set_postBack(
false);
}
}
</script>
</telerik:RadCodeBlock>
Add codebehined with following
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
Telerik.Web.UI;
namespace
TabStripMasterPageSample
{
public partial class Content : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
AddTab(
"Test");
AddPageView(TabStrip.FindTabByText(
"Test"));
AddTab(
"Test3");
AddTab(
"Test2");
}
}
private void AddTab(string tabName)
{
var tab = new RadTab { Text = tabName };
TabStrip.Tabs.Add(tab);
}
protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
{
string userControlName = e.PageView.ID + ".ascx";
var userControl = Page.LoadControl(userControlName);
userControl.ID = e.PageView.ID +
"_userControl";
e.PageView.Controls.Add(userControl);
}
private void AddPageView(RadTab tab)
{
var pageView = new RadPageView { ID = tab.Text };
RadMultiPage1.PageViews.Add(pageView);
pageView.CssClass =
"pageView";
tab.PageViewID = pageView.ID;
}
protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
{
System.Threading.
Thread.Sleep(10000);
AddPageView(e.Tab);
e.Tab.PageView.Selected =
true;
}
}
}