Hi,
I build an aspx page which contains only one RadTabStrip and its RadMultiPage.
In the page_load event (in the behind code), I build dynamically the RadTabStrip and the RadMultiPage
For each value the named Session field, i create a RadTab and a PageView, like in the live demo example.
I also implemented the function AddTab and AddPageView
and the event PageViewCreate on the RadMultiPage
My user control content:
So When I click on the RadToolBarButton the ajax Postback is well fired, the second times is a not an ajax postback it's a simple postback, the RadAjaxManager is not on ajaxrequest, and my usercontrols disappear.
Could you help me?
I build an aspx page which contains only one RadTabStrip and its RadMultiPage.
In the page_load event (in the behind code), I build dynamically the RadTabStrip and the RadMultiPage
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!Page.IsPostBack)
{
string
[] arguments = Session[SessionParameterName.LISTDOCTOVISU]
as
string
[];
for
(
int
i = 0; i < arguments.Length; i++)
{
AddTab(arguments[i]);
AddPageView(RadTabStripDocView.Tabs[i]);
}
}
}
For each value the named Session field, i create a RadTab and a PageView, like in the live demo example.
I also implemented the function AddTab and AddPageView
private
void
AddTab(
string
codeDoc)
{
RadTab tab =
new
RadTab();
tab.Text = codeDoc;
tab.Attributes.Add(
"CodeDoc"
, codeDoc);
tab.Value = codeDoc;
RadTabStripDocView.Tabs.Add(tab);
}
private
void
AddPageView(RadTab tab)
{
RadPageView pageView =
new
RadPageView();
pageView.ID =
"PageView_ID_"
+ tab.Value;
pageView.Attributes.Add(
"CodeDoc"
, tab.Value);
RadMultiPageDocView.PageViews.Add(pageView);
tab.PageViewID = pageView.ID;
}
and the event PageViewCreate on the RadMultiPage
protected
void
RadMultiPage1_PageViewCreated(
object
sender, RadMultiPageEventArgs e)
{
string
codeDoc = e.PageView.Attributes[
"CodeDoc"
];
if
(!
string
.IsNullOrEmpty(codeDoc))
{
string
userControlName =
"usercontrol/ViewerDocument.ascx"
;
ViewerDocument userControl = Page.LoadControl(userControlName)
as
ViewerDocument;
userControl.ID = e.PageView.ID +
"_ViewerDocument"
;
userControl.CodeDoc = e.PageView.Attributes[
"CodeDoc"
];
e.PageView.Controls.Add(userControl);
}
}
My user control content:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewerDocument.ascx.cs"
Inherits="Class_iWebAsp.usercontrol.ViewerDocument" %>
<
telerik:RadCodeBlock
runat
=
"server"
ID
=
"PreviewDocumentForMultiDocCodeBlock"
>
<
script
type
=
"text/javascript"
>
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadAjaxManagerProxy
ID
=
"RadAjaxManagerProxy1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"RadToolBarPaging"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadSplitter1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManagerProxy
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Default"
>
</
telerik:RadAjaxLoadingPanel
>
<
telerik:RadSplitter
ID
=
"RadSplitter1"
runat
=
"server"
Width
=
"100%"
Height
=
"100%"
Orientation
=
"Horizontal"
>
<
telerik:RadPane
ID
=
"RadPaneToolBarPaging"
runat
=
"server"
Scrolling
=
"None"
Height
=
"35px"
Width
=
"100%"
>
<
telerik:RadToolBar
ID
=
"RadToolBarPaging"
runat
=
"server"
AutoPostBack
=
"true"
OnButtonClick
=
"RadToolBarPaging_buttonClick"
Width
=
"100%"
>
<
Items
>
<
telerik:RadToolBarButton
ImageUrl
=
"../images_toolbar/arrow_first.gif"
Value
=
"first"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
ImageUrl
=
"../images_toolbar/arrow_prev.gif"
Value
=
"prev"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
IsSeparator
=
"true"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
PostBack
=
"false"
Value
=
"info"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"LabelInfo"
runat
=
"server"
Text
=
"Page 1/1"
></
asp:Label
>
</
ItemTemplate
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
IsSeparator
=
"true"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
ImageUrl
=
"../images_toolbar/arrow_next.gif"
Value
=
"next"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
ImageUrl
=
"../images_toolbar/arrow_last.gif"
Value
=
"last"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
IsSeparator
=
"true"
/>
<
telerik:RadToolBarButton
ImageUrl
=
"../images_toolbar/zoom_arriere_16x.png"
Value
=
"zoommois"
PostBack
=
"false"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
ImageUrl
=
"../images_toolbar/zoom_avant_16x.png"
Value
=
"zoomplus"
PostBack
=
"false"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
IsSeparator
=
"true"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
ImageUrl
=
"../Icons/pdf.jpg"
Value
=
"saveas"
Target
=
"_blank"
PostBack
=
"false"
ToolTip
=
"Télécharger(version PDF)"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
ImageUrl
=
"../Images/saveas.gif"
Value
=
"saveasOri"
Target
=
"_blank"
PostBack
=
"false"
ToolTip
=
"Télécharger(vesion original)"
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
ImageUrl
=
"../Images/print.gif"
Value
=
"print"
PostBack
=
"false"
Visible
=
"false"
ToolTip
=
"Imprimer"
>
</
telerik:RadToolBarButton
>
</
Items
>
</
telerik:RadToolBar
>
</
telerik:RadPane
>
<
telerik:RadPane
ID
=
"RadPanePreviewDoc"
runat
=
"server"
>
qsfhklqjfqklsfqklfjqlfjqlkf
</
telerik:RadPane
>
</
telerik:RadSplitter
>
<
asp:HiddenField
ID
=
"HiddenFieldPageNumber"
runat
=
"server"
Value
=
"1"
/>
<
asp:HiddenField
ID
=
"HiddenFieldPageTotal"
runat
=
"server"
Value
=
"1"
/>
So When I click on the RadToolBarButton the ajax Postback is well fired, the second times is a not an ajax postback it's a simple postback, the RadAjaxManager is not on ajaxrequest, and my usercontrols disappear.
Could you help me?