I am using Telerik Controls 2011.1.315.35
We have a load on demand RadMultiPage linked with a RadToolBar
There are several pages and it successfully loads only the page I require when it first loads.
The problem occurs when I click on the tool bar to open another page, the page loads correctly but at the same time it will load the original page again as well, losing any of the values that have been changed in that page.
If I click back to the original page and change a value and then click back to the 2nd page I opened then all is well and the 1st page will not reload.
The tool bar click is controlled by a JavaScript function
function onButtonClicked(sender, args)
{
var multipage=$find("MultpageView");
var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>');
var pageView = multipage.findPageViewByID(args.get_item().get_value())
if(pageView ==null)
{
ajaxManager.ajaxRequest(args.get_item().get_value());
}
else
{
pageView.set_selected(true);
ResizeFrame();
}
}
This is working and the new page will only be added to the MultiPage if it hasn't already been added. What I need to do is prevent the Pages that have been added from reloading and losing any values that have been changed.
Each page is contained in its own control that is added to the new page
Ajax Call on Server side is as follows
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
AddPageView(e.Argument)
End Sub
Private Sub AddPageView(ByVal pageViewID As String)
Dim pageView As New RadPageView()
pageView.ID = pageViewID
If MultpageView.FindPageViewByID(pageViewID) Is Nothing Then
MultpageView.PageViews.Add(pageView)
End If
End Sub
When the new Page View is created the control is added using the PageVIewCreated event
Protected Sub MultpageView_PageViewCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMultiPageEventArgs) Handles MultpageView.PageViewCreated
Dim UserControlName As String = e.PageView.ID + ".ascx"
Dim userControl As Control = Page.LoadControl("PageControls/" & UserControlName)
userControl.ID = e.PageView.ID + "_userControl"
e.PageView.Controls.Add(userControl)
MultpageView.FindPageViewByID(e.PageView.ID).Selected = True
End Sub
We have a load on demand RadMultiPage linked with a RadToolBar
There are several pages and it successfully loads only the page I require when it first loads.
The problem occurs when I click on the tool bar to open another page, the page loads correctly but at the same time it will load the original page again as well, losing any of the values that have been changed in that page.
If I click back to the original page and change a value and then click back to the 2nd page I opened then all is well and the 1st page will not reload.
The tool bar click is controlled by a JavaScript function
function onButtonClicked(sender, args)
{
var multipage=$find("MultpageView");
var ajaxManager = $find('<%= RadAjaxManager1.ClientID %>');
var pageView = multipage.findPageViewByID(args.get_item().get_value())
if(pageView ==null)
{
ajaxManager.ajaxRequest(args.get_item().get_value());
}
else
{
pageView.set_selected(true);
ResizeFrame();
}
}
This is working and the new page will only be added to the MultiPage if it hasn't already been added. What I need to do is prevent the Pages that have been added from reloading and losing any values that have been changed.
Each page is contained in its own control that is added to the new page
Ajax Call on Server side is as follows
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
AddPageView(e.Argument)
End Sub
Private Sub AddPageView(ByVal pageViewID As String)
Dim pageView As New RadPageView()
pageView.ID = pageViewID
If MultpageView.FindPageViewByID(pageViewID) Is Nothing Then
MultpageView.PageViews.Add(pageView)
End If
End Sub
When the new Page View is created the control is added using the PageVIewCreated event
Protected Sub MultpageView_PageViewCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMultiPageEventArgs) Handles MultpageView.PageViewCreated
Dim UserControlName As String = e.PageView.ID + ".ascx"
Dim userControl As Control = Page.LoadControl("PageControls/" & UserControlName)
userControl.ID = e.PageView.ID + "_userControl"
e.PageView.Controls.Add(userControl)
MultpageView.FindPageViewByID(e.PageView.ID).Selected = True
End Sub