Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 17, 2012 @ 16:31
    Marc-Anthony Taylor
    0

    dialogHandler_temp.Create() causing a nullReferenceException

    I am trying to replicate the create content function for a custom context item. When I click create I get the following NullReferenceException, can anyone suggest anything. (I have asked a couple of times--perhaps not as clearly-- but I am desperate, I only have 3 days of my internship left and this would be a great way to go out)

    [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:116
       OptionalMultiLangPage.SbmtClick(Object sender, EventArgs e) in c:\inetpub\wwwAmaris\optional_multiLang.aspx.cs:97
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3803
  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 17, 2012 @ 16:36
    Marc-Anthony Taylor
    0

    I am using v4.9 -- sorry, should have mentioned that

  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 17, 2012 @ 17:43
    Marc-Anthony Taylor
    0

    I got this sorted. It took me a while to realise that helper.Request("nodeType") wasn't to return the new node's type, rather the xml node value of what is being done. This must be assigned somewhere out-with the the Umbraco Content class so I missed it. It should be set to the value of "content".

    My code now looks like:

    privatevoidDoCreation(){if(!Page.IsValid)return;conststring xmlNodeVal ="content";var nType =int.Parse(nodeType.SelectedValue);var nId =int.Parse(Request["nodeID"]);var rName = rename.Text;var returnUrl = dialogHandler_temp.Create(xmlNodeVal, nType, nId, rName);var cur =Current;if(cur !=null) cur.ClientTools.ChangeContentFrameUrl(returnUrl).CloseModalWindow();}
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies