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

Assertion failed length of elements and json must be the same

3 Answers 101 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
A K
Top achievements
Rank 1
A K asked on 28 Apr 2010, 05:42 PM

I have radPanel bar on a page to which I am adding panel items dynamically with user controls.  I want to Ajaxify the radpanel item. When user clicks on Save button on the user control I just want to post that current PanelItem. I am trying to do this by following code. I get Error   Assertion failed length of elements and json must be the same.

This is the code to Add item dynamically:

            With radPanelNew

                  .Text = account.Name.ToString

                  .Value = account.Id.ToString

                  .Font.Italic = True

                  .Font.Underline = True

                  .Font.Size = 10

                  '.ID = account.Id.ToString

            End With

           

            Select Case account.Type.Text

                  Case Entities.Account.AccountType.Bank.ToString

                        If account.SubType.Text = Entities.Account.SubAccountType.Savings.ToString Then

                              Dim ucSavings As SubscriberSetupPages_UserControls_SavingsAccount = CType(LoadControl("~/SubscriberSetupPages/UserControls/SavingsAccount.ascx"), SubscriberSetupPages_UserControls_SavingsAccount)

                              ucSavings.AccountID = account.Id

                              ucSavings.ID = "SA" & account.Id.ToString

                              acct = DirectCast(ucSavings.FindControl("acct1"), SubscriberSetupPages_UserControls_Account)

                              radPanelNewChild.Controls.Add(ucSavings)

radPanelNew.Items.Add(radPanelNewChild)

            With radParentItem

                  .Items.Add(radPanelNew)

                  .DataBind()

                  .Expanded = True

            End With

This is the code to Ajaxify radpanelitem:

 

      Private Sub pnlBarAccounts_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadPanelBarEventArgs) Handles pnlBarAccounts.ItemCreated

            ' Following code is to Ajaxify RadPanelItem

            Dim acct As UserControl

            If e.Item.Controls.Count > 0 Then

                  If Not IsNothing(e.Item.Controls(0)) Then

                        If Not IsNothing(e.Item.Controls(0).ID) Then

                              Select Case (e.Item.Controls(0).ID.ToString).Substring(0, 2)

                                    Case "SA"

                                          acct = DirectCast(e.Item.Controls(0), SubscriberSetupPages_UserControls_SavingsAccount)

                              End Select

                        End If

                  End If

            End If

            If Not IsNothing(acct) Then

                  Dim btnSave As ImageButton = DirectCast(acct.FindControl("btnSave"), ImageButton)

                  If Not IsNothing(btnSave) Then

                        RadAjaxManagerProxyAcctSetup.AjaxSettings.AddAjaxSetting(btnSave, e.Item)

                  End If

            End If

 

      End Sub

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 03 May 2010, 01:15 PM
Hi A K,

Could you please verify whether the error appears if the Ajax is disabled on the page.

Regards,
Maria Ilieva
the Telerik team


Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
A K
Top achievements
Rank 1
answered on 03 May 2010, 08:19 PM
yes it works fine when Ajax is disabled. As soon as I enable Ajax, control is seen on the page but it goes in javascript error.
0
Maria Ilieva
Telerik team
answered on 05 May 2010, 02:33 PM
Hello,

Please open a regular support ticket and send us sample runnable application. We will test it locally and advise you further.

Sincerely yours,
Maria Ilieva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Ajax
Asked by
A K
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
A K
Top achievements
Rank 1
Share this question
or