I got this error from GetCacheItem internal method.
{"Object reference not set to an instance of an object."}
This is generic, not sure exactly what is causing this. I did add a new cache key, and a new node. The node can open create dialog box, but after I enter an alias, and press create, that is when I received this error. I appreciate any pointers you can provide.
The error came from inside the "simple.ascx.cs" sbmt_click event. The error message came from catch:
try
{
var returnUrl = LegacyDialogHandler.Create(
new HttpContextWrapper(Context),
new User(Security.CurrentUser),
Request.GetItemAsString("nodeType"),
nodeId,
rename.Text.Trim(),
Request.QueryString.AsEnumerable().ToDictionary(x => x.Key, x => (object)x.Value));
BasePage.Current.ClientTools
.ChangeContentFrameUrl(returnUrl)
.ReloadActionNode(false, true)
.CloseModalWindow();
}
catch (Exception ex)
{
CustomValidation.ErrorMessage = "* " + ex.Message;
CustomValidation.IsValid = false;
}
}
because I have a new task defined "SchoolProgramTasks.cs":
public override bool PerformSave()
{
var checkingSchoolProgram = cms.businesslogic.schoolprogram.SchoolProgram.GetByAlias(Alias);
}
And my businesslogic "SchoolProgram.cs":
public static SchoolProgram GetByAlias(string alias)
{
return ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem<SchoolProgram>(
GetCacheKey(alias),
timeout: TimeSpan.FromMinutes(30),
getCacheItem: () =>
{
var schoolprogram = ApplicationContext.Current.Services.SchoolProgramService.GetByAlias(alias);
if (schoolprogram == null) return null;
return new SchoolProgram(schoolprogram);
});
}
I traced the error to inside "DeepCloneRuntimeCacheProvider.cs" and the "GetCacheItem" call. There, I got object reference error.
I wonder if that is because of permission issues. The school program is a node under a new application I created. I have another node under "settings" application and that seems to work.
I have added a new application "School", and in the application, I want users to create new programs. I have a similar feature working under "Settings". I think the difference is that "Settings" is an out of box features, and my school application application is customization.
To answer your question:
1) I run version 7.4.1
2) I defined a new task SchoolProgramTasks.aspx, and the task create action is defined in the UI.xml that calls the simple.ascx
Runtime Cache Provider Error
Hello,
I got this error from GetCacheItem internal method.
{"Object reference not set to an instance of an object."}
This is generic, not sure exactly what is causing this. I did add a new cache key, and a new node. The node can open create dialog box, but after I enter an alias, and press create, that is when I received this error. I appreciate any pointers you can provide.
Best, -Don
Hi Don,
When does this error occur ? Do you have a code example ?
Dave
Hello Dave,
The error came from inside the "simple.ascx.cs" sbmt_click event. The error message came from catch:
because I have a new task defined "SchoolProgramTasks.cs":
And my businesslogic "SchoolProgram.cs":
I traced the error to inside "DeepCloneRuntimeCacheProvider.cs" and the "GetCacheItem" call. There, I got object reference error.
I wonder if that is because of permission issues. The school program is a node under a new application I created. I have another node under "settings" application and that seems to work.
Thank you for your help, -Don
Hi Don,
A couple of more questions :
In general I would like to to know what your goal is.
Dave
Hello Dave,
I have added a new application "School", and in the application, I want users to create new programs. I have a similar feature working under "Settings". I think the difference is that "Settings" is an out of box features, and my school application application is customization.
To answer your question:
1) I run version 7.4.1 2) I defined a new task SchoolProgramTasks.aspx, and the task create action is defined in the UI.xml that calls the simple.ascx
Best, -Don
Hi Don,
I see you are using .NET user controls and webforms for building your custom application in the backend.
Since Umbraco 7 the backend is built with Angular and it is also preferred that you extend it that way.
I did a talk at 2014 Umbraco UK fest on building custom applications in Umbraco using Angular. Most of the concepts still apply.
You can see the source code of the talk here : https://bitbucket.org/dawoe/umbukfestival2014
And the video of the talk on Youtube : https://www.youtube.com/watch?v=_sX9eZSn9HI
I also just found these video's on Youtube, but haven't watched them my self : https://www.youtube.com/watch?v=NY0OXGaCWVU&list=PLIJFrS8cNs2DagJaLFMTZn8oO11EbmL
And if it's data in database tables you want to edit maybe this package can help you speed up the development : https://our.umbraco.org/projects/developer-tools/ui-o-matic/
Dave
Thank you Dave for the info. I will look at them.
Right now, I just need to get it to work as I am short on time.
Best, -Don
is working on a reply...