+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / sitefinity image manager throw exception some time :Value cannot be null. Parameter name: type

sitefinity image manager throw exception some time :Value cannot be null. Parameter name: type

3 posts, 0 answered
  1. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    29 Aug 2011
    Link to this post
    HI,

    i am using  image manager using provider. this image manager throw error some times(not always) like this

    Server Error in '/myproject' Application.


    Value cannot be null.
    Parameter name: type

    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.ArgumentNullException: Value cannot be null.
    Parameter name: type

    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:

    [ArgumentNullException: Value cannot be null.
    Parameter name: type]
       System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +7681290
       Telerik.Web.UI.RadFileExplorer.InitContentProvider(String selectedUrl) +228
       Telerik.Web.UI.RadFileExplorer.InitContentProvider() +140
       Telerik.Web.UI.RadFileExplorer.get_ContentProvider() +24
       Telerik.Web.UI.RadFileExplorer.BindExplorer() +48
       Telerik.Web.UI.RadFileExplorer.OnLoad(EventArgs e) +139
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Control.LoadRecursive() +141
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.5446; ASP.NET Version:2.0.50727.5420


    here is my code for image manager
    DialogOpener DialogOpener1 =e.Item.FindControl("DialogOpener1") as DialogOpener;
                    FileManagerDialogParameters imageManagerParameters = new FileManagerDialogParameters();
                    imageManagerParameters.ViewPaths = new string[] { "~/imagefolder/A" };
                    imageManagerParameters.UploadPaths = new string[] { "~/imagefolder/A" };
                    imageManagerParameters.DeletePaths = new string[] { "~/imagefolder/A" };
                    imageManagerParameters.MaxUploadFileSize = 5242880;
                    imageManagerParameters.FileBrowserContentProviderTypeName = typeof(ChangeImageSizeProvider).AssemblyQualifiedName;
     
                    // If you don't set the following property, the default value will be used 
                    imageManagerParameters.SearchPatterns = new string[] { "*.jpg", "*.gif", "*.png" };
     
                    DialogDefinition imageManager = new DialogDefinition(typeof(ImageManagerDialog), imageManagerParameters);
                    imageManager.ClientCallbackFunction = "ImageManagerFunction";
                    imageManager.Width = Unit.Pixel(750);
                    imageManager.Height = Unit.Pixel(440);
                    imageManager.Parameters["EnableImageEditor"] = false;
     
     
     
     
                    //If you need to customize the dialog then register the external dialog files
                    imageManager.Parameters["ExternalDialogsPath"] = "~/EditorDialogs/";
     
                    DialogOpener1.DialogDefinitions.Add("ImageManager", imageManager);

    please  provide me any solution ?  what is the problem ? please see the attachment also for clarity.
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    01 Sep 2011
    Link to this post
    Hello Humayoo,

    Please take a look at this forum thread which discusses the same problem: http://www.telerik.com/community/forums/aspnet-ajax/editor/using-the-image-manager-dialog-to-get-images-from-a-database.aspx.

    Regards,
    Radoslav Georgiev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. humayoo
    humayoo avatar
    89 posts
    Registered:
    25 Oct 2010
    05 Sep 2011
    Link to this post
    Hello,

    i am getting  error when i used 'Gettype' instead of 'typeof'. please see the attachment for error details.

    thanks
    Humayoo
Register for webinar
3 posts, 0 answered