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

[Solved] Can't set a View as an updated control for ajax manager

3 Answers 151 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
andieje
Top achievements
Rank 1
andieje asked on 23 Jun 2009, 02:56 PM
Hi

I am trying to set a view from a multiview as an updated control in rad ajax manager.

This is the aspx

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="btnSubmit">

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="vwSuccess" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

When the page runs i get this error

 

Controls added to a ViewCollection must be of type View.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Controls added to a ViewCollection must be of type View.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Controls added to a ViewCollection must be of type View.]
   System.Web.UI.WebControls.ViewCollection.AddAt(Int32 index, Control v) +92
   Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +123
   Telerik.Web.UI.RadAjaxControl.PerformRender() +420
   Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1223
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +87
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +98
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +21
   System.Web.UI.Page.Render(HtmlTextWriter writer) +27
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +53
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +310
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7375


many thanks

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 26 Jun 2009, 12:15 PM
Hello andieje,

RadAjax can updated only entire controls, not merely parts of a server control (view of asp MultiView in your case), otherwise the viewstate of these controls cannot be kept consistent. Hence you will need to wrap the MultiView inside asp Panel (since the MultiView does not render html itself) and set the id of the panel as an updated control.
 
Also verify that your multiview control has the following structure:

        <asp:MultiView ID="MultiView1" runat="server">  
            <asp:View runat="server">  
            </asp:View> 
            .........................  
        </asp:MultiView> 

Regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
andieje
Top achievements
Rank 1
answered on 30 Jun 2009, 09:29 AM
Hi

I was able to get it to work my setting the ID of the multiview in the rad ajax manager and not the id of the view. But you said that wouldn't work because the multiview doesn't render html Is that right?
0
Sebastian
Telerik team
answered on 30 Jun 2009, 10:17 AM
Hello andieje,

Indeed that was my conclusion. Nevertheless, it seems that in your case the ajax manager succeeded in identifying the multiview instance on the page - feel free to use your approach is applicable.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
andieje
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
andieje
Top achievements
Rank 1
Share this question
or