Expected ':' javascript error on dynamically created control

4 posts, 0 answers
  1. A K
    A K avatar
    49 posts
    Member since:
    Apr 2010

    Posted 22 Apr 2010 Link to this post

    I am getting following error on dynamically crated user control

    I have pasted code starting at line 1784.

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB6.4; FunWebProducts; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
    Timestamp: Thu, 22 Apr 2010 13:35:02 UTC

    Message: Expected ':'
    Line: 1784
    Char: 754
    Code: 0
    URI: http://localhost/SecurityPages/SubscriberLogin.aspx?ReturnUrl=%2fSubscriberSetupPages%2fPiggyBankSetup.aspx

     



    Sys.Application.add_init(function() {

        $create(Telerik.Web.UI.RadCalendar, {"_DayRenderChangedDays":{},"_FormatInfoArray":[["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["January","February","March","April","May","June","July","August","September","October","November","December",],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",],"dddd, MMMM dd, yyyy h:mm:ss tt","dddd, MMMM dd, yyyy","h:mm:ss tt","MMMM dd","ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","M/d/yyyy","h:mm tt","yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","MMMM, yyyy","AM","PM","/",":",0],"_ViewRepeatableDays":{},"_ViewsHash":{ctl00_ContentPlaceHolder1_pnlbarPiggyBank_i1_i0_i0_6740f64c-f5df-457c-a07c-a89af82cf500_dtTargetDate_calendar_Top : [[2010,4,1], 1]},"_calendarWeekRule":0,"_culture":"en-US","_enableViewSelector":false,"_firstDayOfWeek":7,"_postBackCall":"__doPostBack(\u0027ctl00$ContentPlaceHolder1$pnlbarPiggyBank$i1$i0$i0$6740f64c-f5df-457c-a07c-a89af82cf500$dtTargetDate$calendar\u0027,\u0027@@\u0027)","clientStateFieldID":"ctl00_ContentPlaceHolder1_pnlbarPiggyBank_i1_i0_i0_6740f64c-f5df-457c-a07c-a89af82cf500_dtTargetDate_calendar_ClientState","enableMultiSelect":false,"enabled":true,"monthYearNavigationSettings":["Today","OK","Cancel","Date is out of range.","False","True","300","300"],"skin":"Default","specialDaysArray":[],"stylesHash":{DayStyle: ["", ""],CalendarTableStyle: ["", "rcMainTable"],OtherMonthDayStyle: ["", "rcOtherMonth"],TitleStyle: ["", ""],SelectedDayStyle: ["", "rcSelected"],SelectorStyle: ["", ""],DisabledDayStyle: ["", "rcDisabled"],OutOfRangeDayStyle: ["", "rcOutOfRange"],WeekendDayStyle: ["", "rcWeekend"],DayOverStyle: ["", "rcHover"],FastNavigationStyle: ["", "RadCalendarMonthView RadCalendarMonthView_Default"],ViewSelectorStyle: ["", "rcViewSel"]},"useColumnHeadersAsSelectors":false,"useRowHeadersAsSelectors":false}, null, null, $get("ctl00_ContentPlaceHolder1_pnlbarPiggyBank_i1_i0_i0_6740f64c-f5df-457c-a07c-a89af82cf500_dtTargetDate_calendar"));
  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 23 Apr 2010 Link to this post

    Hi,

    Your code is completely unreadable. Do use the code formattter tool of the ticket editor and try again.

    Thanks.

    Regards,
    Tsvetoslav
    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.
  3. A K
    A K avatar
    49 posts
    Member since:
    Apr 2010

    Posted 23 Apr 2010 Link to this post

    This is not my code. This is what I see at the line number when I do view Source in IE. I am just dynamically loading the user control. This is the code I am adding dynamically RadpanelItem to the panel Bar. and insde item is a user control.
    When the page is rendered above code I see from the view source with javasript error. But this same control If I don't load dynamically  Instead I add to radpanel at design time, I don't see above error.


     

    Private Sub SetPanelItems(ByVal account As PiggyBankAccount, ByVal radParentItem As RadPanelItem, ByVal focusAccountId As String, ByVal memorizednames As Collection(Of Item(Of Integer)), ByVal piggyBankEligibleAccountCollection As Collection(Of Item(Of Guid)), ByVal period As Collection(Of Item(Of Integer)))

     

     

    Dim radPanelNew As New RadPanelItem 'New items will be added to panel bar

     

     

    Dim radPanelNewChild As New RadPanelItem

     

     

    With radPanelNew

     

    .Text = account.Name.ToString

    .Value = account.Name

    .Font.Italic =

    True

     

    .Font.Underline =

    True

     

    .Font.Size = 12

    .Font.Bold =

    True

     

     

    End With

     

     

    If UCase(account.Id.ToString) = UCase(focusAccountId) Then 'Trying to set expanded property to true to set focus to particular account. This is needed when this page is called from Alert set up to show account related to selected Alert

     

    radPanelNewChild.Expanded =

    True

     

     

    End If

     

     

    Dim ucPiggyBank As SubscriberSetupPages_UserControls_PiggyBank = CType(LoadControl("~/SubscriberSetupPages/UserControls/PiggyBank.ascx"), SubscriberSetupPages_UserControls_PiggyBank)

     

     

    With ucPiggyBank

     

    .PiggyBankID = account.Id

    .ID = account.Id.ToString

     

    'Setting up following 3 properties here to avoid database trips

     

    .PiggyBankEligibleAccounts = piggyBankEligibleAccountCollection

    .MemorizedNames = memorizednames

    .Period = period

     

    End With

     

    radPanelNewChild.Controls.Add(ucPiggyBank)

    radPanelNew.Items.Add(radPanelNewChild)

    radPanelNew.Expanded =

    True

     

     

    With pnlbarPiggyBank

     

    .Items.Add(radPanelNew)

    .DataBind()

     

    End With

     

  4. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 28 Apr 2010 Link to this post

    Hi,
    Unfortunately the provided code lines are not sufficient to pinpoint the reason for the problem as obviously the json for the RadCalendar controls gets faulted and I can see no RadCalendar in your code snippet. Please, open up a formal support ticket and send a runnable version of your implementation. We shall debug it and get back to you with our findings.

    Thanks.

    All the best,
    Tsvetoslav
    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.
Back to Top