Copied to clipboard

Flag this post as spam?

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


  • James King 11 posts 20 karma points
    Jul 11, 2009 @ 22:02
    James King
    0

    Error when trying to load content

    Hi all,

    You helped me the other day and now I hope you can help me again. I finally got around to figuring out how to write content from the umbraco editor into my .aspx pages on visual studio but now my website shows error when I try to view it! Please help I am new to asp.net and not sure what to do with this.

    ---

    Server Error in '/' Application. <hr size="1" />

    Object reference not set to an instance of an object. 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.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Line 19:         protected void PageLoad(object sender, EventArgs e)
    Line 20: {
    Line 21: Node Homepage = new Node(1056);
    Line 22: string homepageText = Homepage.GetProperty("bodyText").Value;
    Line 23: MyLiteral.Text = homepageText;
    Instance() +39
    umbraco.library.GetXmlNodeById(String id) +32
    umbraco.presentation.nodeFactory.Node..ctor(Int32 NodeId) +130
    MHM2009.Default.PageLoad(Object sender, EventArgs e) in C:\inetpub\wwwroot\MHM2009\MHM2009\Default.aspx.cs:21
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +50
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

  • Tommy Poulsen 514 posts 708 karma points
    Jul 11, 2009 @ 22:19
    Tommy Poulsen
    0

    Hi, have you defined any content in the bodyText property on your frontpage? It is by default available on the frontpage content node, on Content section there is by default a bodyText property. Add some text here, and try again.

     

    >Tommy

     

  • James King 11 posts 20 karma points
    Jul 11, 2009 @ 22:38
    James King
    0

    Yes I have created a file called homepage under the website folder un der content and I have some random test text I put there under content tab in the large editor box I imagine is the bodyText.

    I have then linked the node with the nodefactory api in visual studio (and it is published and I've triple checked the node number is correct).

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 11, 2009 @ 23:11
    Peter Dijksterhuis
    0

    I still don't get the actuall point of your behaviour like this.

    Umbraco is a CMS, meaning, editors can edit content in the backend, users can view the content in the front-end. There really is no deed to create your own aspx-files for that.

    Take a look at Warren's starterkit. It'll show you exactly what can be easily achieved by using umbraco. (<span style="color: #000000; font-family: Verdana; font-size: 10px; line-height: normal;">http://our.umbraco.org/projects/creative-website-starter-(cws)

    To get back on topic: because you are trying to get data from umbraco from your own page, you must make sure that umbraco is part of your solution. You cannot retrieve information out of umbraco if it is not (well, you could create a webservice for that, but that's not the point here)

    HTH,

    PeterD

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 11, 2009 @ 23:12
    Peter Dijksterhuis
    0

    Sorry for that mess....here goes again:

    http://our.umbraco.org/projects/creative-website-starter-(cws)

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 11, 2009 @ 23:13
    Peter Dijksterhuis
    0

    hm, the link is incomplete because it strips out the ( and ), but you get the point right?

  • James King 11 posts 20 karma points
    Jul 11, 2009 @ 23:29
    James King
    0

    Thanks Peter i got the link I will check it out.

    To answer your question it is because I already have done the designs and I don't want to go through the hassle of transferring it all over to umbraco I just want the clients to be able to edit their own data so that was why I was looking for a CMS that I could extract the text from but if Umbraco has to be in the solution it doesn't seem like it's gonna work. I have it set up on a sub domain that I want all clients to access.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 11, 2009 @ 23:36
    Peter Dijksterhuis
    0

    The only thing to do would be copying your template into umbraco then. I don't know if you have created masterpages for your project, but umbraco can use masterpages as well. The design is pretty straight-forward html right? 

    I strongly suggest your create a local site on your PC, install umbraco and then install Warren's package. It'll give you a very good overview of what is possible with umbraco.

    And trust me, it is more pain to try and create this yourself then to copy your template in umbraco and let umbraco do all stuff for you!

  • James King 11 posts 20 karma points
    Jul 11, 2009 @ 23:41
    James King
    0

    Hmm master pages you say? I'll give it a try with a test site I guess.

    Thanks again

Please Sign in or register to post replies

Write your reply to:

Draft