我已经调整了 Umbraco 创建上下文菜单项以复制内容。我一直在努力解决小问题,但我现在陷入困境。尝试使用该dialogHandler_temp.Create()
方法时,我得到了一个NullReferenceException
.
使用的所有变量都不为空,页面也不为空。有谁知道我该如何排序?
private void DoCreation()
{
if (!Page.IsValid)
return;
var hel = helper.Request("nodeType");
var nType = int.Parse(nodeType.SelectedValue);
var nId = int.Parse(Request["nodeID"]);
var rName = rename.Text;
var cur = Current;
if (cur != null) // dialogHandler_temp.Create() is a static method
cur.ClientTools.ChangeContentFrameUrl(dialogHandler_temp.Create(hel, nType, nId, rName)).CloseModalWindow();
}
堆栈跟踪:
[NullReferenceException: Object reference not set to an instance of an object.]
umbraco.presentation.create.dialogHandler_temp.Create(String NodeType, Int32 TypeId, Int32 NodeId, String Text) +278
OptionalMultiLangPage.DoCreation() in c:\inetpub\wwwAmaris\optional_multiLang.aspx.cs:112
OptionalMultiLangPage.SbmtClick(Object sender, EventArgs e) in c:\inetpub\wwwAmaris\optional_multiLang.aspx.cs:96
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3803