CodeGarden 10: The sixth annual Umbraco Developer Conference
June 23-25th 2010 - free ASP.NET MVC pre-conference. Register today!

reloading a single node

7/2/2009 9:24:41 PMAvatarrah_135Location: Puneposts: 23Karma: 20

I want to reload a single current node from a usercontrol. Can somebody help me with the exact code.

Thanks,

7/2/2009 11:42:47 PMAvatarRichard SoetemanLocation: 2102LB, The NetherlandsVendor.posts: 692Karma: 1412
Comment with ID: 8477
Response.Redirect("/umbraco/editContent.aspx?id=1048"); 

Just replace the hardcoded id with Request.Querystring Id and I think that should work.

Cheers,

Richard

7/2/2009 11:50:47 PMAvatarNico LubbersLocation: wijchen, hollandposts: 141Karma: 143
Comment with ID: 8478

In the c# code of the usercontrol include the following namespace

using umbraco.presentation.nodeFactory;

Then you have access directly to the data of the currentNode:

        protected void Page_Load(object sender, EventArgs e)
        {
            Node node = Node.GetCurrent();
            string somevalue = node.GetProperty("field/alias-of-the-documenttype").Value;

            // do something with somevalue
        }

Regards, Nico

Please login or Sign up To post replies