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

RadEditor: Value Cannot be null error when using custom Content Provider

3 Answers 110 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Software
Top achievements
Rank 1
Software asked on 10 Sep 2012, 05:59 PM
We bought Q2 2012 SP1 (version 2012.2.724) to upgrade the old version. The primary purpose of the Telerik is to use the Radeditor as the WYSIWYG editor and manage file uploads. We'd been using old version for many years in the past and thought of upgrading due to new features and better browser support.

The default installation works ok in both dev and prodcution environment but wanted to use customprovider for all file uploads. The moment I switch to custom provider the Radedior File upload dialogs stars giving "Value Cannnot be null" erro intermittenetly. This happens only in production environement and the error pops up 50% of the time. When trying to expand the folder tree it hangs with the "rotating wheel animation" sometimes due to the same error.


Please help

Dev Environment: Windows 7 / IIS7 / Asp.NET 3.5
Production Environment: Windows Server 2008 / IIS 7 / Asp.Net 3.5



My sample code block is below.
protected void Page_Load(object sender, System.EventArgs e)
{
string[] sImagePath = new string[] {"/_Global/" + ModuleProperties.SiteID + "/img/content"};
radEdtContent.ImageManager.ViewPaths = sImagePath;
radEdtContent.ImageManager.UploadPaths = sImagePath;
radEdtContent.ImageManager.ContentProviderTypeName = typeof(myprovider).AssemblyQualifiedName;
}
public class myprovider : Telerik.Web.UI.Widgets.FileSystemContentProvider
{
public myprovider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
: base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
{
}
public override string StoreFile(UploadedFile file, string path, string name, params string[] arguments)
{
//StoreFile method handles renaming of files if exists.
string fileExtention = name.Substring(name.LastIndexOf("."));
string fileNameWithoutExtension = name.Substring(0, name.IndexOf("."));
string newFileName = fileNameWithoutExtension + DateTime.UtcNow.Ticks + fileExtention;
string result = base.StoreFile(file, path, newFileName, arguments);
return result;
}


The Error

Server Error in '/' 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) +7681546
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) +216
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

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Sep 2012, 08:01 AM
Hi,

According to the error the fully qualified name value of the ContentProviderTypeName is null during the Page_Load event. This is very odd and it would be very hard or even impossible to help you if you are unable to provide reliable reproduction steps for this problem. My suggestion is to examine your server logs for any additional clues for what is causing the issue.

You can also upgrade to the latest Q2 2012 SP2 (2012.2 912 (Sep 12, 2012)) and see whether the problem still persists.

Best regards,
Rumen
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.
0
Software
Top achievements
Rank 1
answered on 13 Sep 2012, 02:11 PM
Hi Rumen

Thank you very much for the answer.

I 'm not doing anything special here. I was just adding
1. radEdtContent.ImageManager.ContentProviderTypeName = typeof(myprovider).AssemblyQualifiedName;

in the page load with the addition of the

    2. public class myprovider : Telerik.Web.UI.Widgets.FileSystemContentProvider {}

class as mentioned in your blog elsewhere.

Without 1 above the editor works fine. I guess this will give you a hint for reproducing it. I have to stress the fact that this works 100% ok in my dev environment, problem is when i moved it to production which is of different environement.

Dev Environment: Windows 7 / IIS7 / Asp.NET 3.5
Production Environment: Windows Server 2008 / IIS 7 / Asp.Net 3.5

Having said that where can I download Q2 2012 SP2 (2012.2 912 (Sep 12, 2012))
I will try upgrading and let you know if there is any improvement or not.

Also please give me the upgrade steps as well.

Thanks

0
Rumen
Telerik team
answered on 13 Sep 2012, 03:22 PM
Hi,

The development and production environments are the same and are running on IIS7 and .NET 3.5. Since the problem is random on the production environment this means that something happens behind the scenes and you should inspect your server logs for more information. If you do not provide reliable steps to replicate the problem, I am afraid that we will be unable to help you.

You can follow the instructions from this KB article in order to upgrade your controls to a newer version of the suite.


Kind regards,
Rumen
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.
Tags
Editor
Asked by
Software
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Software
Top achievements
Rank 1
Share this question
or