F is null or not an object

5 posts, 1 answers
  1. Achuthan
    Achuthan avatar
    31 posts
    Member since:
    May 2007

    Posted 06 Jan 2012 Link to this post

    Hello All,
            I created radscheduler in asp.net application, i bind the sql table values in to radscheduler. in month view for particular day i have more than 50 appointments there, so radscheduler only shows 5 appointments and they show more option, if i click the more option in month view it will throw the f is null or not an object error
           Could anyone face this issue before please reply me, i want to resolve this

    Thanks.
  2. Answer
    Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 06 Jan 2012 Link to this post

    Hi Achuthan,

    Indeed, SharePoint used to have issues while loading scripts dynamically upon Ajax request.
    However this was fixed within the Microsoft Office 2010 October cumulative update.

    In case you haven't applied this update, I am suggesting you register the RadScheduler scripts from code-behind at CreateChildControls event of the WebPart:

    [ToolboxItemAttribute(false)]
    public class Test2RS : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/TabStripGrid/Test2/Test2UserControl.ascx";
     
        protected override void CreateChildControls()
        {
            Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
     
            RegisterScripts();
        }
     
        protected virtual void RegisterScripts()
        {
     
            string assemblyFullName = System.Reflection.Assembly.GetAssembly(typeof(RadScheduler)).FullName;
            ScriptManager scriptManager = ScriptManager.GetCurrent(Page);
     
            if (scriptManager != null)
            {
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Common.Core.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Common.jQuery.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Common.jQueryPlugins.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Common.Popup.PopupScripts.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Common.Navigation.NavigationScripts.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Common.TouchScrollExtender.js" });
     
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.ClientRendering.ClientRendering.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.ClientRendering.BlockCollection.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.ClientRendering.HorizontalBlockCollection.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.ClientRendering.RenderingManager.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.ClientRendering.ResourceStyleMapping.js" });
     
     
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.ClientRendering.ResourceStyleMappingCollection.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Menu.RadMenuScripts.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Menu.ContextMenu.RadContextMenuScripts.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Input.TextBox.RadInputScript.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Input.DateInput.RadDateInputScript.js" });
     
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Input.InputManager.RadInputManagerScript.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Input.MaskedTextBox.RadMaskedInputScript.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Input.NumericTextBox.RadNumericInputScript.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Calendar.RadTimeViewScripts.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Calendar.RadCalendarCommonScript.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Calendar.RadCalendarScript.js" });
     
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Calendar.RadPickersPopupDirectionEnumeration.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Calendar.RadDatePicker.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Calendar.RadDateTimePickerScript.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Calendar.RadTimeViewScripts.js" });
     
     
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.ComboBox.RadComboBoxScripts.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Helpers.DateTime.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.RadSchedulerScripts.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.RecurrenceEditor.RecurrenceEditor.js" });
     
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.ContextMenu.Plugin.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Week.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Week.GroupedByResource.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Week.GroupedByDate.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.MultiDay.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.MultiDay.GroupedByResource.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.MultiDay.GroupedByResource.Model.js" });
     
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Day.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Day.GroupedByResource.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Month.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Month.GroupedByResource.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Timeline.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByResource.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Views.Timeline.GroupedByDate.Model.js" });
                scriptManager.Scripts.Add(new ScriptReference() { Assembly = assemblyFullName, Name = "Telerik.Web.UI.Scheduler.Scheduling.AdvancedTemplate.js" });
     
     
            }
        }
    }

    The attached sample is based on the project that you have sent within a support ticket.

    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
  3. Achuthan
    Achuthan avatar
    31 posts
    Member since:
    May 2007

    Posted 16 Jan 2012 Link to this post

    Thanks Kalina,
              It's working now
  4. Michael
    Michael avatar
    11 posts
    Member since:
    Feb 2013

    Posted 18 Apr 2013 Link to this post

    Hi,

    has this problem really been solved in an cumulative Update? I can't find any informations for that fix. We still have sometimes similar problems, even with the Service Pack 1. 

    Regards,
    Michael
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 22 Apr 2013 Link to this post

    Hi Michael,

    Did you try registering the scripts as suggested in the previous post? What you need to do is get the needed scripts (depending on the controls that you use) and register them manually. Here you can get more information on which scripts you need to use for the different controls. 

    Regards,
    Kate
    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