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
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.
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).
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)
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.
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!
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:
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
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).
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
Sorry for that mess....here goes again:
http://our.umbraco.org/projects/creative-website-starter-(cws)
hm, the link is incomplete because it strips out the ( and ), but you get the point right?
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.
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!
Hmm master pages you say? I'll give it a try with a test site I guess.
Thanks again
is working on a reply...