PreIntialize javascript error

6 posts, 0 answers
  1. Pooja
    Pooja avatar
    55 posts
    Member since:
    Feb 2011

    Posted 24 Jan 2012 Link to this post

    Hi,
    I am getting following error in scheduler. 


    Message: '0._preInitialized' is null or not an object
    Line: 1144
    Char: 1
    Code: 0
    URI: XXX/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2011.3.1115.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3acf16ab29-be3a-4761-9f9e-2c05ea68ff51%3a4c8be21a%3a650fdad%3aef9d9f4a%3aa51ee93e%3a59462f1%3a19620875%3a39040b5c%3af85f9819

    This error is intermittent but frequent, I tried reproducing the error in a sample code, but the error is not reproducible there. Few things which might be helpful.
    1. I am using the scheduler inside a usercontrol
    2. This user control is loaded inside an updatepanel.
    3. I am also using RadTooltipManager to show tooltips for appointment 
    4. The user control has radajaxmanagerproxy which update the scheduler and tooltipmanager
    5. This error usually comes when I try to navigate between views.

      The axd script which throws error is 

    b.RadScheduler._preInitialize=function(p,o,m,k,l){var n=d("#"+p);
    if(n[0]._preInitialized&&!$telerik.isIE){return;
    }
    Please let me know if this is a known issue or at least what this script is trying to do
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Jan 2012 Link to this post

    Hello Pooja,

    Check the following forum thread which discussed similar scenario.
    Java Error on Scheduler

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pooja
    Pooja avatar
    55 posts
    Member since:
    Feb 2011

    Posted 25 Jan 2012 Link to this post

    I applied the registerscript solution, but it is still giving me the error.

     I don't think problem is with any missing javascript, problem is in the line
    if(n[0]._preInitialized&&!$telerik.isIE){return;
    } 

    while debugging I got "n" as calendar control but n[0] was undefined. While navigating before going to sever, it is making this javascript call, any idea on this.
  5. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 30 Jan 2012 Link to this post

    Hi Pooja,

    In fact, SharePoint has issues when the RadAjaxManager is declared at markup in a user control.

    Let me suggest you overcome this by adding the RadAjaxManager at OnInit event of the web part.
    Additionally please add the AjaxSettings in this manner:

    private const string _ascxPath = @"~/_CONTROLTEMPLATES/SchedulerWebPartProject/SchedulerWebPart/VisualWebPart1UserControl.ascx";
      
    protected override void CreateChildControls()
    {
    }
      
    RadAjaxManager ajaxmgr;
    protected override void OnInit(EventArgs e)
    {
      
        base.OnInit(e);
      
        ajaxmgr = new RadAjaxManager();
        Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
        Page.Form.Controls.AddAt(0, ajaxmgr);
      
    }
      
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
      
        Control control = Page.LoadControl(_ascxPath);
        Controls.Add(control);
      
        RadCalendar calendar = control.FindControl("RadCalendar1") as RadCalendar;
        RadScheduler scheduler = control.FindControl("RadScheduler1") as RadScheduler;
      
        ajaxmgr.AjaxSettings.AddAjaxSetting(calendar, scheduler);
    }

    The code above is quite simplified – one RadCalendar updates one  RadScheduler  - but I believe it illustrates the approach properly.
    In case the issue persists - please provide us more details about your implementation.

    Regards,
    Kalina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  6. Pooja
    Pooja avatar
    55 posts
    Member since:
    Feb 2011

    Posted 01 Feb 2012 Link to this post

    Hi Kalina,

    My issue is not related to sharepoint, it is more related to dynamically loading a user control(say scheduler control) in the page. This user control contains scheduler, first time when schedulercontrol is loaded scheduler is working fine, on some other event I am reloading the schedulercontrol, then when I navigate between views, I am getting that javascript error.
  7. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 01 Feb 2012 Link to this post

    Hi,

    Can you try to isolate the problem further by removing separately RadToolTipManager and RadAjaxProxy and test if the error is still reproducible?

    Kind regards,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017